I
Imran Aziz
Hello All,
I am using the following code
DataSet ds = new DataSet();
try
{
strQuery = "SELECT sChannelTitle, sChannelDescription, nChannelID,
dDateAdded, sChannelType, nUserID" +
" FROM tblFeedChannels ";
if (strSearch != "" || sFeedType != "")
{
strQuery = strQuery + "where tblFeedChannels.sChannelTitle like '%" +
strSearch + "%' and sFeedType='" + sFeedType + "'";
}
SqlDataAdapter myCommand = new SqlDataAdapter(strQuery, conn);
// Create and fill a DataSet.
myCommand.Fill(ds);
}
catch (SqlException ex)
{
strError = "Error is " + ex.Message;
}
return ds;
but on some situations based on search the SqlDataAdapter does not return
any results, how do I check the number of rows returned from the command so
that I dont fill the dataset accordingly and just set it to null.
Thanks a lot.
Imran.
I am using the following code
DataSet ds = new DataSet();
try
{
strQuery = "SELECT sChannelTitle, sChannelDescription, nChannelID,
dDateAdded, sChannelType, nUserID" +
" FROM tblFeedChannels ";
if (strSearch != "" || sFeedType != "")
{
strQuery = strQuery + "where tblFeedChannels.sChannelTitle like '%" +
strSearch + "%' and sFeedType='" + sFeedType + "'";
}
SqlDataAdapter myCommand = new SqlDataAdapter(strQuery, conn);
// Create and fill a DataSet.
myCommand.Fill(ds);
}
catch (SqlException ex)
{
strError = "Error is " + ex.Message;
}
return ds;
but on some situations based on search the SqlDataAdapter does not return
any results, how do I check the number of rows returned from the command so
that I dont fill the dataset accordingly and just set it to null.
Thanks a lot.
Imran.