how to give row from datatable to datareader
or how to specify row in datatable and move between datatable rows?
Can i specify row in datatable
2 Answers
Know the answer? Post it. Somebody with the same question will find it here.
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend4days leftRegister
Jignesh TrivediRank #16 · 50.3K reputationPosted Jan 6, 2013, 6:17 PM EST
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.
ahmed fahd57 reputationPosted Jan 7, 2013, 7:40 AM EST
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 ?