How to retrieve data row by row from a DataTable?
Thanks In advance
PriyaPP

Answer Posted / 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



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is an asp.net validator? And, mention its types.

780


What are the best practices to follow to secure connection strings in an ASP.NET web application?

770


Explain how viewstate is being formed?

732


List some of the important session state modes of asp.net.

704


Which dll handles the request of .aspx page?

739


Explain the use of errorprovider control in .net?

688


What is asp net_sessionid?

816


What language does asp.net use?

736


1.What r collections? 2.What is .pdb file? 3.Is it possible to provide access to users in master page? 4.What is dirty n Phantom Read(SQL)? 5.What r different isolation levels(SQL)? 6.How to set authentication mode in web.config file?

2030


Where the cookie value is stored?

702


What is virtual directory in asp.net?

733


How is application management and maintenance improved in asp.net 2.0?

729


Explain the main differences between asp and asp.net?

718


Is there any alternative to avoid name collisions other then Namespaces?

804


What is an assembly? Explain its parts.

823