Received: from maia.hub.org (maia-3.hub.org [200.46.204.243]) by mail.postgresql.org (Postfix) with ESMTP id F065A6322C7 for ; Tue, 3 Aug 2010 13:47:06 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.243]) (amavisd-maia, port 10024) with ESMTP id 96882-06 for ; Tue, 3 Aug 2010 16:46:59 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from jupiter.marktest.pt (delta.marktest.pt [80.251.174.116]) by mail.postgresql.org (Postfix) with ESMTP id B26E963332B for ; Tue, 3 Aug 2010 13:46:59 -0300 (ADT) Received: from Proteu (proteu.marktest.pt [10.61.90.54]) by jupiter.marktest.pt with SMTP (Microsoft Exchange Internet Mail Service Version 5.5.2653.13) id P5AX6WTZ; Tue, 3 Aug 2010 17:46:57 +0100 Message-ID: <7C2FED61BE684CDD8CBAA745D6B37F24@marktestcr.marktest.pt> From: "Oliveiros d'Azevedo Cristina" To: Cc: References: <1BBEE93EA22B44CF870E6F37B350FF59@marktestcr.marktest.pt> Subject: Re: Detecting a Null field on an NpgsqlDataReader object Date: Tue, 3 Aug 2010 17:46:54 +0100 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="UTF-8"; reply-type=original Content-Transfer-Encoding: 8bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2900.5512 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5579 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=1.229 tagged_above=-5 required=5 tests=BAYES_50=0.8, STOX_REPLY_TYPE=0.439, T_RP_MATCHES_RCVD=-0.01 X-Spam-Level: * X-Archive-Number: 201008/3 X-Sequence-Number: 6931 Olá! >> For ex, in Sql Server we just compare with DbNull singleton. >> >> What is the equivalent in Npgsql? >> > > You can use the same way. Npgsql uses DBNull singleton to express null > values. > If you are trying to check in the NpgsqlDataReader, you will need to > use the method IsDBNull(int) > > I hope it helps. > > Oh, I see. All in all it's the same mechanism . Yes, I'm indeed trying to check in a NpgsqlDataReader. I'll give that method a try. Obrigado, Oliveiros