Read Data Table Using Data Reader

How to read DataTable using DataReader? (DataTable is already filled).

Questions by shamu_1984   answers by shamu_1984

Showing Answers 1 - 3 of 3 Answers

Using CreateDataReader() Function, we can read the data

DataTableReader dtr = ds.Tables[0].CreateDataReader();

        while (dtr.Read())
        {

            for (int idx=0; idx < dtr.FieldCount;idx++ )
                Response.Write(dtr[idx]);

            Response.Write("<br/>");
        }

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions