SqlDataAdapter da=new SqlDataAdapter(cmd);
DataSet ds = new DataSet();
da.Fill(ds);
string str = string.Empty;
// Condition to check if it
contains data or not
if(ds.Tables.Count>0)
{
// Condition to check if dataset
tables contains data or not
if (ds.Tables[0].Rows.Count > 0)
{
str = "Dataset
table contains data";
}
}
else
{
str = "Dataset
does not contains data";
}
|
Dim da As New SqlDataAdapter(cmd)
Dim ds As New DataSet()
da.Fill(ds)
Dim str As String = String.Empty
' Condition to check if it
contains data or not
If ds.Tables.Count > 0 Then
' Condition to check if dataset
tables contains data or not
If ds.Tables(0).Rows.Count > 0 Then
str = "Dataset
table contains data"
End If
Else
str = "Dataset
does not contains data"
End If
|
|
If you enjoyed this post, please support the blog below. It's FREE! Get the latest Asp.net, C#.net, VB.NET, jQuery, Plugins & Code Snippets for FREE by subscribing to our Facebook, Twitter, RSS feed, or by email. |
|||
Subscribe by RSS
Subscribe by Email
|
|||
|
|
Subscribe by RSS
Subscribe by Email
0 comments :