class InspectionEquip : DataSet
{
private readonly SqlConnection CPEC = new SqlConnection(ConfigurationManager.ConnectionStrings["ConnectionString"].ToString());
public InspectionEquip(string store)
{
CPEC.Open();
SqlCommand comm = new SqlCommand("Select * From Equip3 Where Store = '" + store + "'", CPEC);
SqlDataAdapter da = new SqlDataAdapter(comm);
da.Fill(/* What to Put Here? Tried "this" and it just returns blank */);
CPEC.Close();
}
}
答案 0 :(得分:0)
您的SQL查询存在问题(没有匹配的数据,错误的参数)。 da.Fill(this)
工作正常。
如果您需要证明 - 请将此SqlCommand
行与您交换......
SqlCommand comm = new SqlCommand("select * from INFORMATION_SCHEMA.COLUMNS", CPEC);