SQL SERVER, DataRows and Null Dates
- From: "aaj" <aaj@xxxxxxx>
- Date: Wed, 15 Jun 2005 12:06:29 +0100
Hi all
I've spent ages looking on google for the answer to what I would guess is a
really common problem. Can anyone here help me out.
I read a view from SQL Server 2000 into a DataSet
>From here I select some rows matching a certain criterea.
In the selected row is a column of type datetime that I'm interested in.
Before assigning a local variable to the value in the DataRow Column, I
simply want to check if its null
i.e.
DateTime InspectionDate;
foreach (DataRow CurrentRow in FinalSide)
{
if (sqldatenull.CompareTo(CurrentRow["upload_date"]) ????? or anything to
check for non null ????? == 0 )
{
InspectionDate= Convert.ToDateTime(CurrentRow["upload_date"]);
MessageBox.Show(InspectionDate.ToLongDateString());
}
}
I can't find anything to check if its empty of of its Null.
The best I can do is to use convert and catch the exception error, but I'm
guessing there must be a cleaner way of doing this.
thanks in advance
Andy
.
- Follow-Ups:
- Re: SQL SERVER, DataRows and Null Dates
- From: Ignacio Machin \( .NET/ C# MVP \)
- RE: SQL SERVER, DataRows and Null Dates
- From: tbain
- Re: SQL SERVER, DataRows and Null Dates
- Prev by Date: Re: About Thread Completion Notify.
- Next by Date: RE: SQL SERVER, DataRows and Null Dates
- Previous by thread: Problem with HttpDownloader by Kent Boogaart
- Next by thread: RE: SQL SERVER, DataRows and Null Dates
- Index(es):
Relevant Pages
|