友財產我已經正確綁定數據集的下拉列表,但它給這個錯誤: 我的代碼是:數據綁定:「System.Data.DataRowView」不包含名稱爲「產品ID」
要綁定威剛設置
DataSet ds = new ViewAction().GetAllProductInfoData();
ddlprdctname.DataSource = ds;
ddlprdctname.DataTextField = "ProductName";
ddlprdctname.DataValueField ="ProductID";
ddlprdctname.DataBind();
和GetAllProductInfoData()函數是
public DataSet GetAllProductInfoData()
{
SqlCommand cmd = DataConnection.GetConnection().CreateCommand();
cmd.CommandText = "Select ProductID ProductName,SubCategory2ID,CompanyID,Price,Quantity,Description from ProductInfo";
SqlDataAdapter da = new SqlDataAdapter(cmd);
DataSet ds = new DataSet();
da.Fill(ds);
cmd.Dispose();
DataConnection.CloseConnection();
return ds;
}
什麼是錯誤,請HELLP我解決
ohh多麼愚蠢的錯誤謝謝 – VJain