yash patel

yash patel

  • NA
  • 274
  • 19.4k

getting network error

Oct 15 2020 11:44 PM
I m getting network error
 
unable to understand what is the error
  1. public class UserModel  
  2. {  
  3. public int UserId { getset; }  
  4. public String FullName { getset; }  
  5. public String UserEmail { getset; }  
  6. public String Password { getset; }  
  7. static string ConnectionString = "Data Source=DESKTOP-O00000/SQL2017;Initial Catalog=nsroute;Integrated Security=True";  
  8. public static IEnumerable<UserModel> GetUserDetails()  
  9. {  
  10. List<UserModel> userdetailslist = new List<UserModel>();  
  11. using (IDbConnection con = new SqlConnection(ConnectionString))  
  12. {  
  13. if (con.State == ConnectionState.Closed)  
  14. con.Open();  
  15. userdetailslist = con.Query<UserModel>("GetUserDetails").ToList();  
  16. }  
  17. return userdetailslist;  
  18. }  
  19. }  

Answers (2)