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 application state?
What are merge modules?
What are the various authentication mechanisms in ASP.NET ?
1 Answers Digital GlobalSoft, Satyam,
What is xaml? Are xaml file compiled or built on runtime?
Types of objects in ASP?
Describe the two main components of the .NET framework ?
What is a postback ispostback and autopostback in asp net?
Define application state variable and session state variable?
Details on web.config and global.asax - just explain what are the sections will be there.
About Garbage Collector?
Why session is necessary in web application?
How do you set language in web.cofig ?