DATASET

A

anonymous22

I HAVE THE FOLLOWING CODE WHERE I AM PASSING A READER TO
ICOLLECTION.
I NEED TO PASS A DATASET AND STILL DO THE SAME THINGS (
ICollection DataSource(DATASET DS) ....
HOW DO I DO THIS?

ICollection DataSource(OleDbDataReader Reader)
{
DataTable dt = new DataTable();
DataRow dr;
try
{ dt.Columns.Add(new DataColumn("title_id", typeof
(string)));
while (Reader.Read())
{
dr = dt.NewRow();
dr[0] = Reader.GetValue(0).ToString();
dt.Rows.Add(dr);
}
}
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

aspnet examples question 3
Dataset problem 0
Delete rows in Gridview 0
Getting dataset? 5
Gridview with hyper link 1
Repeater DataSource. This is driving me crazy. 2
Errors 3
Extra line in GridView 1

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,065
Latest member
OrderGreenAcreCBD

Latest Threads

Top