Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


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

Answers were Sorted based on User's Feedback



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

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

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

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

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

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

Post New Answer

More ASP.NET Interview Questions

Explain how can we inherit a static variable?

0 Answers  


What are ASP.NET Web Forms? How is this technology different than what is available though ASP (1.0-3.0)?

1 Answers   Siebel Systems,


What is the advantage of mvc over asp.net? : Asp.Net MVC

0 Answers  


How to kill more than one session variables at a time

9 Answers   iSoft,


Where session variables are stored?

0 Answers  


Describe the disadvantage of cookies.

0 Answers  


how to write html code with ssl

0 Answers   DCI,


while developing webservices if i want some users to use my webservice only how can i give security to my webservice?

0 Answers  


What is smart navigation?

1 Answers  


What is GAC in ASP.NET 2.0

0 Answers   MCN Solutions,


How do you store a value in viewstate and retrieve them?

0 Answers  


How can we identify that the Page is Post Back?

0 Answers  


Categories