how to specify row in datatable and move between datatable rows
and can i give this row to datareader?
How to specify row in datatable
1 Answer
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:27 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.
to move datarow form one table to other table
var logEntries = new DataTable()
//Fill logEntries data table
...
...
// Move Row from logEntries to datatable.
var dataTable = new DataTable();
dataTable.Columns.Add("EntryType");
dataTable.Columns.Add("TimeGenerated");
dataTable.Columns.Add("Message");
dataTable.Columns.Add("Category");
for (int loop = logEntries.Count - 1; loop >= 0; loop--)
{
var row = new[]
{
logEntries[loop].EntryType.ToString(),
logEntries[loop].TimeGenerated.ToString(),
logEntries[loop].Message,
logEntries[loop].Category
};
dataTable.Rows.Add(row);
}
please refer
http://support.microsoft.com/default.aspx?scid=kb;EN-US;Q308909
hope this will help you.