2
Answers

DATA ADAPTER

Ask a question
Craig

Craig

16y
2.9k
1

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)
Next Recommended Forum