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();
}
}
class InspectionEquip : DataSet { private readonly SqlConnection CPEC = new SqlConnection(ConfigurationManager.ConnectionStrings[ConnectionString].ToString()); public InspectionEquip(string
Share
You have a problem with your SQL query (no matching data, bad parameter).
da.Fill(this)works fine.If you want proof – swap this
SqlCommandline with yours…You should also probably extend
DataTable, notDataSetif you only ever plan on storing a single tables results.