My query is that i have data from database in datatable .
DataTable dt = OBJ.Fetch_PartDetails();
in dt i have all the records .Now i add all the records in list as
List list = new List();
for(int i=0;i
//foreach(var item in dt.Rows)
{
SecretaryUserModel GetAll = new SecretaryUserModel();
GetAll.TransactionDate = dt.Rows[i]["TransactionDate"].ToString();
GetAll.SLNo = Convert.ToInt32(dt.Rows[i]["SLNO"]);
GetAll.Particular = Convert.ToString(dt.Rows[i]["Particular"]);
GetAll.Balance = Convert.ToDecimal(dt.Rows[i]["Balance"]);
GetAll.Credit_Expenses = Convert.ToDecimal(dt.Rows[i]["Credit_Expenses"]);
GetAll.Debit_Expenses = Convert.ToDecimal(dt.Rows[i]["Debit_Expenses"]);
list.Add(GetAll);
}
and finally i send list to the view.
In top of the view page i declared it as
@model IEnumerable
but when i call the object of SecretaryUserModel the error come to me as
ienumerabledoes not contain a definition for fromdate and no extension........
7 Replies
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Vinay SinghPosted Jul 14, 2016, 2:36 AM
Nitin SontakkePosted Jul 14, 2016, 1:39 AM
sourabh choubeyPosted Jul 14, 2016, 1:16 AM
Modal title
Details
Nitin SontakkePosted Jul 14, 2016, 1:12 AM
sourabh choubeyPosted Jul 14, 2016, 1:08 AM
The model item passed into the dictionary is of type 'System.Collections.Generic.List`1[ServiceCatalogue.UI.Areas.BMS.Models.SecretaryUserModel]', but this dictionary requires a model item of type 'ServiceCatalogue.UI.Areas.BMS.Models.SecretaryUserModel'.
this eroor i am getting..sourabh choubeyPosted Jul 14, 2016, 1:06 AM
Nitin SontakkePosted Jul 14, 2016, 12:49 AM