开发者

Checking if dataset is empty in vb.net

How do i check if the dataset is empty? I wro开发者_如何学JAVAte the following code:

Dim da As New SqlDataAdapter("query",connection string)
da.Fill(ds)
If (Not (ds.Tables.Count > 0)) Then
  Response.Redirect("norecords.aspx?str1=" + str1)
end if

In the if condition, I am not able to access ds.Tables[0].rows.count. How should I do this?


Dim cm As New OleDbCommand("Select * from Table1", cn)
da = New OleDbDataAdapter(cm)

If (ds.Tables.Contains("Table1") = False) Then
    da.Fill(ds, "Table1")
End If
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜