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 the namespace used to store the information about the user?s locale?
What do you mean by serialize and marshalbyref?
What is the difference between table and query?
Explain the differences between clr & cts?
how can u create the forms authentication?and what is the difference between forms authentication and windows authentication?
What is inproc mode in session?
If I m using Session State Partioning where I have partitioned my session into 4 servers then how can I know that my session will be stored on which server?
Can we handle the error and redirect to some pages using web.config?
What is the Global ASA(X) File?
What is custom attribute?
How many types cache in asp net?
What are Master Pages in ASP.NET?
Visual Basic (800)
C Sharp (3816)
ASP.NET (3180)
VB.NET (461)
COM+ (79)
ADO.NET (717)
IIS (369)
MTS (11)
Crystal Reports (81)
BizTalk (89)
Dot Net (2435)
Exchange Server (362)
SharePoint (720)
WCF (340)
MS Office Microsoft (6963)
LINQ Language-Integrated Query (317)
WPF (371)
TypeScript (144)
Microsoft Related AllOther (311)