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 |
Define xmlvalidatingreader class.
What are the intrinsic objects present in ASP.NET
How to refresh a page in asp.net
What is the maximum length of textbox
What is a WebService and what is the underlying protocol used in it? Namespace?
Why do we use Option Explicit?
About DataAdapters ?
Explain about asp.net 2.0 themes?
Explain what are delegates?
Define web services in asp.net.
What method must be overridden in a custom control? a) The Paint() method b) The Control_Build() method c) The Render() method d) The default constructor
1 Answers Icertis, Microsoft, Syntax Softtech,
What are the asp.net server side objects?