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
David Green
NA
7
0
Linq to datatable help
Aug 11 2011 5:55 PM
I am trying to load data from my database through a linq command
here is my code
DataTable dtBooking = new DataTable();
dtBooking = (GetGeneric.GetInstance<AdminDriverHelper>().GetDriversHolidays(""));
//dtBooking.Columns.Add("DriverID", Type.GetType("System.Int64"));
//dtBooking.Columns.Add("DriverDate", Type.GetType("System.DateTime"));
//dtBooking.Columns.Add("DriverName", Type.GetType("System.String"));
//int idCount = 1;
for (int i = 1; i <= 5; i++)
{
DataRow dr;
dr = dtBooking.NewRow();
dr["DriverID"] = dtBooking.Rows[0]["DriverID"];
dr["DriverName"] = dtBooking.Rows[0]["DriverName"];
dr["DriverDate"] = dtBooking.Rows[0]["DriverDate"];
dtBooking.Rows.Add(dr);
}
return dtBooking;
}
but I get this error
System.ArgumentException: Column '' does not belong to table Table1.
I am sure its is how I am calling the sproc, but I am unsure
Can anyone help?
Reply
Answers (
1
)
Assembly for Core Linq API
Query difference