Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Stumped with Dataset problem

Status
Not open for further replies.

linuxjr

Programmer
Jun 2, 2001
135
0
0
US
I am trying to refresh my memory with programming in ASP.NET. I have a simple select statement that I know returns records and this code was working but now it doesn't anymore and I can not figure out why?

Code:
    con.Open();
    AsaDataAdapter cmd = new AsaDataAdapter(sqlString.ToString(), con);
    DataSet ds = new DataSet();
    cmd.Fill(ds);
    if(ds == null || ds.Tables[0].Rows.Count == 0)
        lblNoRecord.Visible = true;
    else
	lblNoRecord.Visible = false;
    DataGrid1.DataSource = ds;
    DataGrid1.DataBind();

Any tips or suggestions will be greatly appreciated.
 
I have read the SQL syntax with the ASADataAdapter is case sensative for the column names.

if(ds == null || ds.Tables[0].Rows.Count == 0)
ds won't be null because you used:
DataSet ds = new DataSet();








 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top