I'm a complete newbie to VB.NET, how can I test if a dataset has rows? I'm trying to see if my sql procedure call managed to fill up my dataset.
Also, is there an easy way to print the rows to a label?
I'm a complete newbie to VB.NET, how can I test if a dataset has rows? I'm trying to see if my sql procedure call managed to fill up my dataset.
Also, is there an easy way to print the rows to a label?
If myDataSet.Tables.Count > 0 AndAlso myDataSet.Tables(0).Rows.Count > 0 Then
' The first table contains rows.
End If
Rather than printing to a label, it would be advisable to bind it to an auto-generated gridview.
Drop a gridview onto a page, and once you have your dataset (which I'm assuming has a table you expect data in), drop in the following code
GridView1.DataSource = myDataSet.TableName // if it's strongly typed, use Tables[index] otherwise
GridView1.DataBind()