Craig

Craig

  • NA
  • 20
  • 0

DATA ADAPTER

May 22 2008 3:27 PM

Hello,

Is there an easy way to determine the number of rows created when creating a data adapter (see code below).   I'd like to know if the sql produces any rows.  Is there a property of the data adapter that records the  number of rows.

 

OdbcCommand DbCommand = new OdbcCommand("SELECT x,y FROM DATA_y WHERE x='z', DbConnection);

OdbcDataAdapter myDataAdapter = new OdbcDataAdapter(DbCommand);

DbConnection.Open();

DataSet ds = new DataSet();

myDataAdapter.Fill(ds, "time");

DataTable dt = ds.Tables["time"];

foreach (DataRow row in dt.Rows)

{

}


Answers (2)