友人私はドロップダウンをデータセットに適切にバインドしましたが、このエラーが発生しています:私のコードは:
バインドデータセットへ
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;
}
エラーは何ですか 解決するために私を助けてください