Question - I got an error while debugging the program DataBinding: 'System.Data.DataRowView' does not contain a property with the name 'SupportRepresentative'. Just check the database field also ID and Represenativename columns are present. Please anyone help me for this.
- public void BindSupportActivity_Representativename()
- {
- try
- {
- using (SqlConnection sqlCon = new SqlConnection(@"Data Source=IN5CG9261RDP;Initial Catalog=TASKDETAILS;Trusted_Connection=True"))
- {
- {
- sqlCon.Open();
- string query = "select * from mRepresentative";
- SqlDataAdapter sqladpt = new SqlDataAdapter(query, sqlCon);
- DataTable dt = new DataTable();
- sqladpt.Fill(dt);
- SupportRepresentative.DataSource = dt;
- SupportRepresentative.DataBind();
- SupportRepresentative.DataTextField = "RepresentativeName";
- SupportRepresentative.DataValueField = "ID";
- SupportRepresentative.DataBind();
- }
- }
- }
- catch (Exception ex)
- {
- throw;
- }