TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
sourabh choubey
NA
174
46.5k
how to use ienumerable under which model class is present
Jul 14 2016 12:34 AM
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<SecretaryUserModel> list = new List<SecretaryUserModel>();
for(int i=0;i<dt.Rows.Count;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<ServiceCatalogue.UI.Areas.BMS.Models.SecretaryUserModel>
but when i call the object of SecretaryUserModel the error come to me as
ienumerable<secretarymodel>does not contain a definition for fromdate and no extension........
Reply
Answers (
7
)
how can i pass datetime value to an action method by ajax
how to get mobile GPS id using asp.net c#