Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How we check for not empty dataset?
Message
 
 
To
08/09/2008 16:50:48
John Baird
Coatesville, Pennsylvania, United States
General information
Forum:
ASP.NET
Category:
Coding, syntax and commands
Environment versions
Environment:
C# 3.0
OS:
Windows XP
Network:
Windows 2003 Server
Database:
MS SQL Server
Miscellaneous
Thread ID:
01345899
Message ID:
01345902
Views:
11
>>Hi everybody,
>>
>>Is there a simple way to check if the dataset is empty? I have a button to copy ds to Excel. However, I want to show some message if ds doesn't have records. Should I get the DataTable first and check RowCount?
>>
>>Thanks in advance.
>
>
>if( ds != null && ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0)
>{
> do something here;
>}

Thanks a lot.

May I ask you a more complex question?

We're setting GridView dataset in code. Originally it was defined in the page in SQLDataSource and the Delete worked by itself using DeleteCommand of SQLDataSource.

Now I'm not sure how can I handle it. Do you know if there is a way to somehow specify DeleteCommand for DataSet?
If it's not broken, fix it until it is.


My Blog
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform