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();
}
}
问问题
260 次
1 回答
0
您的 SQL 查询有问题(没有匹配的数据,错误的参数)。da.Fill(this)
工作正常。
如果你想要证据 -SqlCommand
用你的交换这条线......
SqlCommand comm = new SqlCommand("select * from INFORMATION_SCHEMA.COLUMNS", CPEC);
于 2012-05-30T15:06:34.450 回答