Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post Mar 23, 2007 02:18 AM by mbanavige
Mar 23, 2007 01:36 AM|LINK
I have a textbox and button on my webform. I have a field in the database with data type integer and allowing null value to be entered.
But when user keeps the textbox blank and clicks the button, its giving me following error:
Incorrect Syntax near ','
But when user enters some value its inserting. How to solve it?
Mar 23, 2007 02:18 AM|LINK
Empty Textboxes are not null values. They contain an empty string. So you are actually trying to insert an empty string into your integer column .
You could check your Textbox.Text property and if it's an empty string you would instead substitute DbNullValue for your insert.