How to retrieve data row by row from a DataTable?
Thanks In advance
PriyaPP
Answers were Sorted based on User's Feedback
Answer / guest
foreach(Datarow dr in table.rows)
{
string str = dr[0].ToString();
string str1 = dr["columnName"].ToString();
}
Is This Answer Correct ? | 11 Yes | 3 No |
Answer / suyash deep
best way to retrieve data is-
//dtTable is Data table
//dtrow id Data Row object
string str;
foreach(DataRow dtrow in dtTable.rows)
{
str= dtrow ["emp_Name"].Tostring();
//emp_Name is the column name
// now use str variable as you want to manipulate.
}
Is This Answer Correct ? | 6 Yes | 0 No |
Answer / digvijay
In C#
foreach(DataRow dr in dt.rows) //dt is Data table
{
string ABC= dr["Coloumn_Name"].Tostring;
}
Is This Answer Correct ? | 3 Yes | 2 No |
What is work flow gen? how can it will work with .Net?
In ViewState How much lifespan items stored?
Where would you use an ihttpmodule, and what are the limitations if any?
Can we use html in asp.net?
what is new debug tools in asp.net ?
Should I delete cookies?
how many session modes are available?some brief explnation
Page Life Cycle in ASP.NET
Difference between ADO.net Dataset , ADO Record Set & ADO Data Reader?
Differentiate globalization and localization.
What are the options in ASP.NET to maintain state?
What is the difference between mechine.config and web.config?