Thanks Chris!
This is my function FillSqlDataAdapter code:
public void FillSqlDataAdapter(string strFillQry,string DSname)
{
gConn=new SqlConnection();
gConn.ConnectionString=gstrConn;
gDA =new SqlDataAdapter(strFillQry,gConn.ConnectionString);
gDS=new DataSet();
gDA.Fill(gDS,DSname);
gDT=new DataTable();
gDT=gDS.Tables[0];
}// FillSqlDataAdapter
where the gVariable stands for GlobalVariable.
"Chris van Bergen" <
[email protected]>
???????:
[email protected]...
Hello Jason,
If I get your question right.....
The reason why you will get a DataSet with one DataTable is you asked
for a table. The result is therefor a table, only this time without
rows.
also:
- If you ask the MyDataSet.Tables[yourTable].Rows.Count it will be 0
- If you ask the MyDataSet.Tables[yourTable].Columns.Count you will see
that it has as many columns as your table Customer in your database.
Hope this answered your question
Cheers
Christiaan
Hi,
The SQL string is "select * from Customer where 0 > 1", and the
DataSet
should be null.
Why MyDataSet.Tables.Count is 1, not 0? What kind of DataTable in
this
place?
Thanks for help.
Jason