how to give row from datatable to datareader
or how to specify row in datatable and move between datatable rows?
Loading
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.
ahmed fahdPosted Jan 7, 2013, 12:40 PM
i have rows in sqltable
i have to select the row by it's row index in the base table of sql
so i tried to selec t all the rows to the datatable after that i tried to add the row by it's index in the datatable
do you have another idea or suitable query to do it in sql directly ?
Jignesh TrivediPosted Jan 6, 2013, 11:17 PM
DataReader object provides a read only, forward only, high performance mechanism to retrieve data from a data store, so i think you cannot move data from datatable to datareader.
but it may possible to move datarow from datareader to datatable.
SqlDataReader reader = cmd.ExecuteReader();
DataTable dt = new DataTable();
if (reader.Read())
{
dt.Load(reader);
}
please refer
http://www.eggheadcafe.com/PrintSearchContent.asp?LINKID=628
http://www.dotnetcurry.com/ShowArticle.aspx?ID=143
hope this will help you.