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
精彩评论