string[] Parameters = new string[3] { "@USER_ID", "@Company_ID", "@DRIVER_NAME" };
string[] DbTypes = new string[3] { "varchar", "int", "varchar" };
string[] ParameterTypes = new string[3] { "input", "input", "input" };
string[] values = new string[3] { (Session["UserID"].ToString()), ddlCompany.SelectedValue.ToString(), txt_DRIVER_NAME.Text.Trim() };
string[] Lengths = new string[3] { "50", "5", "20" };
DataUtility du = new DataUtility();
DataSet ds = du.returnDataSet(CommandType.StoredProcedure, "Driver_Zone_Wise", Parameters, DbTypes, ParameterTypes, values, Lengths);
lb_DriverList.DataTextField = "Driver_Name";
lb_DriverList.DataValueField = "DRIVER_ID";
lb_DriverList.DataSource = ds.Tables[0];
****lb_DriverList.DataBind();****
lb_DriverList.Items.Insert(0, new ListItem("Select Vehicle", "0"));
lb_DriverList.SelectedValue = "0";
}
最佳答案
错误表明您的查询结果中没有 Driver_Name
。
检查您的查询和 ds.Tables[0]
并查看您是否拥有 Driver_Name
列。
编辑-1
检查您的过程Driver_Zone_Wise
,确保您返回的列名为Driver_Name
。
关于asp.net - 数据绑定(bind) : 'System.Data.DataRowView' does not contain a property with the name 'Driver_Name' ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20628126/