Priyanka Singh

Priyanka Singh

  • 690
  • 1.4k
  • 676.6k

Entity Framework error whilepopulate the TextBox in the form

Jun 20 2019 12:22 AM
I got the error while populating dropdownlist in Entity Framework.
 
  1. private void PopulateFormFieds(int userID)    
  2. {    
  3.     UserManager userMgr = new UserManager();    
  4.     var result = userMgr.GetUserDetail(userID);    
  5.     if (result.Count > 0)    
  6.     {    
  7.         var user = result.First();    
  8.         tbFirstName.Text = user.FirstName;    
  9.         tbLastName.Text = user.LastName;    
  10.         tbContactNumber.Text = user.ContactNumber;    
  11.     }    
  12.     else    
  13.     {    
  14.         //NO RECORDS FOUND.    
  15.         tbFirstName.Text = string.Empty;    
  16.         tbLastName.Text = string.Empty;    
  17.         tbContactNumber.Text = string.Empty;    
  18.     }    
  19. }    
  20.     
  21. protected void ddlUser_SelectedIndexChanged(object sender, EventArgs e)    
  22. {    
  23.     PopulateFormFieds(Convert.ToInt32(ddlUser.SelectedItem.Value));    
  24. }   
Operator '>' cannot be applied to operands of type 'method group' and 'int'  in 
 
 if (result.Count > 0)  
 
 Help me to resolve the problem.Thank You.

Answers (15)