Miha
Fri Dec 19 16:15:36 CST 2003
Hi Dino,
You are mixing code and sql.
You should do something like:
INSERT INTO tblTable(fldField) VALUES(" + Iif(cboCombo.Enabled,
cboCombo.SelectedItem.ToString(), "null") + ")"
assuming that tblTable and fldField are database names.
--
Miha Markic - RightHand .NET consulting & development
miha at rthand com
www.rhand.com
"Dino M. Buljubasic" <dino.buljubasic@rivusglobal.com> wrote in message
news:RAKEb.162$ss5.36@clgrps13...
> Hi,
> thank you for your reply. The code looks like:
>
> INSERT INTO tblTable(fldField) VALUES(Iif(cboCombo.Enabled,
> cboCombo.SelectedItem, DBNull.Value))
>
> , the fldField is Varchar(10), it allows nulls.
>
> Thank you,
> Dino
>
> --
>
>
> -------------------------------------------------------------------------
> FIGHT BACK AGAINST SPAM!
> Download Spam Inspector, the Award Winning Anti-Spam Filter
>
http://mail.giantcompany.com
>
>
> "Bill Styles" <noemail@nowhere.com> wrote in message
> news:%23TJyRfnxDHA.3196@TK2MSFTNGP11.phx.gbl...
> > "Dino M. Buljubasic" <dino.buljubasic@rivusglobal.com> wrote in message
> > news:VZJEb.149$ss5.60@clgrps13
> > > Hi Miha,
> > >
> > > Using 'null' inside INSERT is not supported anymore. I get error to
> > > use System.DBNull.Value instead but that one inserts an empty string
> > > instead of <NULL>.
> >
> > can you post the actual code that you have to build and execute the
> insert?
> > It sounds like you are mixing levels in what you are doing but it's hard
> to
> > tell exactly what's going on from the description.
> >
> > --
> > C# newbie... posts are probably inaccurate, inelegant or both!
> >
>
>