[Mono-list] asking for null DataSet
carlosble at shidix.com
Thu Oct 27 03:42:48 EDT 2005
El jue, 27-10-2005 a las 09:09 +0600, Gayan Perera escribió:
> dear frnd,
> as to my knowlage yes you can and if you don't have any other option
> this will be what you have to use :D
> best regards,
> On 10/27/05, Carlos Ble <carlosble at shidix.com> wrote:
> I tried to ask for a null DataSet to determine when a SELECT
> return nothing. DataSet are filled with NpgsqlDataAdapter.Fill
> This method never returns null. So you can't ask
> if (dataset == null).
> Searching for DataSet.Tables property I found this from msdn:
> A DataRowCollection that contains DataRow objects; otherwise a
> value if no DataRow objects exist.
> So I tried with dataset.Tables == null but isn't null, because
> DbDataAdapter, an empty table with real name extracted from
> are added to dataset.
> The solution is to ask
> if (dataset.Tables.Rows.Count == 0)
> Is this a good mechanism?
> Could this code run in .Net too?
> Mono-list maillist - Mono-list at lists.ximian.com
More information about the Mono-list