Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Vb.net sql problem
Message
 
 
To
19/01/2012 22:06:57
General information
Forum:
ASP.NET
Category:
Databases
Environment versions
Environment:
VB 9.0
OS:
Windows XP
Database:
MS SQL Server
Miscellaneous
Thread ID:
01533399
Message ID:
01533400
Views:
44
>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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform