>Hi all,
> I use vb.net and TableAdapter. I want to check the @field value include empty string then will adjust the value to NULL.
>Anyone know how can i do, eg. if the @lineno is " " then change to NULL ?
>
>
>INSERT INTO item (itemcode, lineno) values (@itemcode,@lineno)
>
>
>
>thank you
Use NULLIF function, e.g.
insert into Item (ItemCode, LineNo) values (@ItemCode, NULLIF(@LineNo, ''))
If it's not broken, fix it until it is.
My Blog