I searched throughout the website for the error
I am getting this error while binding a dropdown list.
DataBinding: ‘System.Char’ does not contain a property with the name “APPRAISER_ID”
Here’s my code:
DataSet DSEmployee = new DataSet();
DSEmployee = ws_service.GetReportingDtl(user);
ddlEmployee.DataTextField = "APPRAISER_ID";
ddlEmployee.DataValueField = "APPRAISER_ID";
ddlEmployee.DataSource = DSEmployee.Tables[0].DefaultView.ToString();
ddlEmployee.DataBind();
And in my webservice.
string strQ = "select employee_id,appraiser_id from kirti_pms_reporting where appraiser_id='" + varAppraiserId.ToString() + "'";
My Inline code for dropdown list is
<asp:DropDownList ID="ddlEmployee" runat="server" AutoPostBack="true" CssClass="vlu">
What I missed here? The same code works fine in another aspx page.
The problem is that you bind a string to your
DataSourceAnd a string don’t have a property
APPRAISER_ID.Is not a good idea because you could run into SqlInjection.