How to retrieve just one row for a dataset in c#.NET. Database access examples and tutorials.

ONE ROW FROM DATASET

C# Tutorials

  

ONE ROW FROM DATASET

Learn Tutorials
How to retrieve just one row for a dataset in c#.NET. Database access examples and tutorials.

Example code for One row from dataset:
DataSet ds2=dbm.getDataSet("SELECT MAX(transID) AS newestIdentity FROM CreditCardTransactions", "Identity");
   DataRow dr=ds2.Tables["Identity"].Rows[0];
   identity=Convert.ToInt16(dr["newestIdentity"].ToString());

   //no need for foreach iteration
This is example code for how to retrieve just one row for a dataset in c#.net. database access examples and tutorials.