I tired that also but in the visual studio editor on this line below
if ( ds.Tables[0].Rows.Count > 0 ) It tells me that value of type 'system.data.dataTableCollection' cannot be converted to 'boolean'. -----Original Message----- From: Doug Nelson [mailto:[EMAIL PROTECTED] Sent: Monday, April 04, 2005 4:43 PM To: [email protected] Subject: Re: [AspNetAnyQuestionIsOk] CHecking if a returned dataset or table is null if ( ds.Tables.Count > 0 ) { if ( ds.Tables[0].Rows.Count > 0 ) { //Got Rows back } } Note, this is a very defensive method, normally, I know my db call is returning a result set and thus there is no need for the table count test. Hope this helps -- Doug Nelson www.synappnorth.com Yahoo! Groups Links Yahoo! Groups Links <*> To visit your group on the web, go to: http://groups.yahoo.com/group/AspNetAnyQuestionIsOk/ <*> To unsubscribe from this group, send an email to: [EMAIL PROTECTED] <*> Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/
