Re: Stored Procedure return values - Test for DBNull - ASP.NET
From: Jerry Pisk (jerryiii_at_hotmail.com)
Date: 03/25/04
- Next message: Axel: "command.execute"
- Previous message: JS: "Re: BatchOptimistic Locking"
- In reply to: Greg R: "Stored Procedure return values - Test for DBNull - ASP.NET"
- Messages sorted by: [ date ] [ thread ]
Date: Wed, 24 Mar 2004 22:12:50 -0800
There's more than one way, DBNull.Value.Equals(parameter.Value) or you can
cast the value to SqlString which supports null values.
Jerry
"Greg R" <anonymous@discussions.microsoft.com> wrote in message
news:BE171104-3DBD-4550-82A0-0B443B48C301@microsoft.com...
> mystring = (string)parameter.Value; (ASP.NET, C#, MSSQL)
>
> from: sqlcommand output parameter, this returns an error when the Value is
null.
>
> Is there a way to test for DBNull on an output string parameter in C# ?
>
> On a page load I am trying to fill a textbox control with text from an
MSSQL table. Using a stored procedure I get an error when trying to read the
table before it is filled.
>
> If there is not a way to test for a null string, what is the work around?
>
> Thanks,
>
> Greg R
>
>
- Next message: Axel: "command.execute"
- Previous message: JS: "Re: BatchOptimistic Locking"
- In reply to: Greg R: "Stored Procedure return values - Test for DBNull - ASP.NET"
- Messages sorted by: [ date ] [ thread ]