473,413 Members | 1,798 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,413 software developers and data experts.

Check if record is null

I'm outputting data from a SQL server database to a web form (C#).

How can I detect if a value is null in the database?

Thanks
Nov 18 '05 #1
3 4412
Andrew,

To check if a value is null compare to DBNull.Value.

Ex:

if (myTable.Rows[0][0] == DBNull.Value)
...

On Wed, 25 Feb 2004 18:41:34 GMT, Andrew Banks
<ba****@nojunkblueyonder.co.uk> wrote:
I'm outputting data from a SQL server database to a web form (C#).

How can I detect if a value is null in the database?

Thanks


Nov 18 '05 #2
Thanks Wes,

It's appreciated

"Wes Brown" <we*@weDONTslandiSPAMa.orMEg> wrote in message
news:op**************@msnews.microsoft.com...
Andrew,

To check if a value is null compare to DBNull.Value.

Ex:

if (myTable.Rows[0][0] == DBNull.Value)
...

On Wed, 25 Feb 2004 18:41:34 GMT, Andrew Banks
<ba****@nojunkblueyonder.co.uk> wrote:
I'm outputting data from a SQL server database to a web form (C#).

How can I detect if a value is null in the database?

Thanks

Nov 18 '05 #3
In vb, how can I do the same. I mean.... to see if a DataSet it is empty?
--

Thank's (if you try to help me)
Hope this help you (if I try to help you)
ruca

"Wes Brown" <we*@weDONTslandiSPAMa.orMEg> escreveu na mensagem
news:op**************@msnews.microsoft.com...
Andrew,

To check if a value is null compare to DBNull.Value.

Ex:

if (myTable.Rows[0][0] == DBNull.Value)
...

On Wed, 25 Feb 2004 18:41:34 GMT, Andrew Banks
<ba****@nojunkblueyonder.co.uk> wrote:
I'm outputting data from a SQL server database to a web form (C#).

How can I detect if a value is null in the database?

Thanks

Nov 18 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Richard C Buchanan | last post by:
I have a table as follows: - user_id (key) - user_email_address (text) - user_request_date (text) - user_sent_date (time/date) An automated macro...
1
by: Martin | last post by:
Hello Everybody! I have a POLINE table on a SQL Server 2000 DB. Before I update the record I need to check that either field, STORELOC or WONUM has data on it. If both fields are NULL I would...
5
by: Ryan | last post by:
I have some software (written in Delphi 5) which has been working for several months without a problem. I have been given a copy of the database on our development server (SQL 7) and have...
0
by: Fabre Lambeau | last post by:
I've got a problem when adding a CONSTRAINT CHECK on a table by calling a function. It just seems not to work... Here is the table (simplified to only the relevant fields for this case): ...
14
by: deko | last post by:
Is there a way to check user input for illegal characters? For example, a user enters something into a text box and clicks OK. At that point I'd like to run code such as this: illegal =...
1
by: GGerard | last post by:
Hello I am working with Access 2000 I have two tables joined on a one to many relationship between two fields: Table1:FieldID (one) is joined to Table2:FieldMyID (many) Field Properties...
16
by: Brian Tkatch | last post by:
Is there a way to check the order in which SET INTEGRITY needs to be applied? This would be for a script with a dynamic list of TABLEs. B.
1
by: Cesar Zapata | last post by:
Hi, I have a a bound subform and what i'm trying to do is do check if some criteria applies before saving the record and trigger a macro. basically this is what I got. Date Received ...
2
by: skt | last post by:
CREATE PROCEDURE NYCIKCP.LIB_SEQUNCE_GEN(IN "@ADB_DIVISION" VARCHAR(32)) SPECIFIC LIB_SEQUNCE_GEN MODIFIES SQL DATA NOT DETERMINISTIC NULL CALL LANGUAGE SQL BEGIN DECLARE SQLSTATE CHAR(5)...
1
by: gurmet | last post by:
Hi All I have been looking around for help, and finally post this problem. I created a form to edit a record. Before i can click save button on the edit form i need to check if the data that...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.