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 |
Explain how cookies work.
What is the difference between abstract class vs interface? Can give me the real time examples?
What is parse in asp.net?
can i use store procedure in disconnected mode? give me answer
What does the "EnableViewState" property do?
Is viewstate enabled by default?
Explain how can we inherit a static variable?
what is view state and its use
10 Answers DELL, Efextra, HCL,
What is autopost?
I’m having some trouble with cas. How can I diagnose my problem?
Will the asp.net validators run in server side or client side? How do you do client-side validation in .net?
What is web api and why to use it?