Hi,

I have a stored procedures that takes few parameters( lets say 2).
Parameters are value for particular columns.

A column of type "binary' can contain "null".

I want to update a row, so that first column will have some value and second
should contain null. How can I do it?

MyParam.Value = null;
cmd.Parameters.Add(MyParam); // obviously doesn't work

Thanks,
Lubomir

Re: How to put NULL into database column by Misbah

Misbah
Fri Feb 08 12:15:11 CST 2008

Try
MyParam.Value = DBNull.Value

--
Misbah Arefin


"Lubomir" <Lubomir@discussions.microsoft.com> wrote in message
news:66CA2DD4-E242-4A3F-9D45-8D427F1844E0@microsoft.com...
> Hi,
>
> I have a stored procedures that takes few parameters( lets say 2).
> Parameters are value for particular columns.
>
> A column of type "binary' can contain "null".
>
> I want to update a row, so that first column will have some value and
> second
> should contain null. How can I do it?
>
> MyParam.Value = null;
> cmd.Parameters.Add(MyParam); // obviously doesn't work
>
> Thanks,
> Lubomir
>

Re: How to put NULL into database column by Lubomir

Lubomir
Fri Feb 08 12:52:01 CST 2008

Thanks,

Lubomir


"Misbah Arefin" wrote:

> Try
> MyParam.Value = DBNull.Value
>
> --
> Misbah Arefin
>
>
> "Lubomir" <Lubomir@discussions.microsoft.com> wrote in message
> news:66CA2DD4-E242-4A3F-9D45-8D427F1844E0@microsoft.com...
> > Hi,
> >
> > I have a stored procedures that takes few parameters( lets say 2).
> > Parameters are value for particular columns.
> >
> > A column of type "binary' can contain "null".
> >
> > I want to update a row, so that first column will have some value and
> > second
> > should contain null. How can I do it?
> >
> > MyParam.Value = null;
> > cmd.Parameters.Add(MyParam); // obviously doesn't work
> >
> > Thanks,
> > Lubomir
> >