public List<checklist> GetCheckListDetails(int BusinessTypeId, int FilingTypeId)
{
List<checklist> list = new List<checklist>();
try
{
using (var dao = DbActivity.Open())
{
CSqlDbCommand cmd = new CSqlDbCommand(DBProcedures.WorkOrderSearch.USP_INSERT_BUSINESSFILLING_DETAILS);
cmd.Parameters.AddWithValue("BusinessTypeId", BusinessTypeId);
cmd.Parameters.AddWithValue("FilingTypeId", FilingTypeId);
SqlDataAdapter da = new SqlDataAdapter();
DataSet ds = new DataSet();
da.Fill(ds);
list = (from c in ds.Tables[0].AsEnumerable()
select new CheckList()
{
CheckListId = c[0].ToInt(),
Deatil = c[1].ToStr(),
}).ToList();
}
}
catch (Exception ex)
{
Logger.Database.Error(ex.Message, ex);
throw;
}
return list;
}
this is my method to be executed and it is throwing an error called the selectcommand property has not been initialized before calling fill? how to fix it?
thanks in advance