Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP General > a newbie, questions about using asp variables to insert value into numeric column(bigint,int,money)

Reply
Thread Tools

a newbie, questions about using asp variables to insert value into numeric column(bigint,int,money)

 
 
bidepan@gmail.com
Guest
Posts: n/a
 
      11-16-2006
I have a sql server database and want to access data using asp form.
But i always get trouble with inserting/updating data in numeric type
columns.Troubles described as belows.
I used one textbox in asp form to accept int type input (like age). And
i defined a variable in asp code to fetch submitted value of a textbox.
Dim variable1
variable1= request.form("textbox1")
By using Connection_Name.execute "Insert into tablename(column1) values
("&variable1&")"
i wanted to insert values into database.
I got error message like "there are syntax error near..." if the
textbox was blank when the form was submitted
I try to print the sql command by using response.write"Insert into
tablename(column1) values ("&variable1&")"
i get Insert into tablename(column1) values
nothing was there, or just blank between the comma
I think the problem is that i can not insert a Null into a int type
column. But i don't know how to resolve it. Anyone can help? Thanks a
lot

 
Reply With Quote
 
 
 
 
Mike Brind
Guest
Posts: n/a
 
      11-16-2006
<(E-Mail Removed)> wrote in message
news:(E-Mail Removed) ups.com...
>I have a sql server database and want to access data using asp form.
> But i always get trouble with inserting/updating data in numeric type
> columns.Troubles described as belows.
> I used one textbox in asp form to accept int type input (like age). And
> i defined a variable in asp code to fetch submitted value of a textbox.
> Dim variable1
> variable1= request.form("textbox1")
> By using Connection_Name.execute "Insert into tablename(column1) values
> ("&variable1&")"
> i wanted to insert values into database.
> I got error message like "there are syntax error near..." if the
> textbox was blank when the form was submitted
> I try to print the sql command by using response.write"Insert into
> tablename(column1) values ("&variable1&")"
> i get Insert into tablename(column1) values
> nothing was there, or just blank between the comma
> I think the problem is that i can not insert a Null into a int type
> column. But i don't know how to resolve it. Anyone can help? Thanks a
> lot
>


http://www.aspfaq.com/etiquette.asp?id=5003

Answered in .db

--
Mike Brind


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Put variables into member variables or function variables? tjumail@gmail.com C++ 9 03-23-2008 04:03 PM
int to numeric numeric(18,2) ? jobs ASP .Net 2 07-22-2007 12:32 AM
Arithmetic overflow error converting numeric to data type numeric. darrel ASP .Net 4 07-19-2007 09:57 PM
how to compare value of two fileds and based on that insert value into third fileds Tradeorganizer ASP General 5 01-31-2007 04:51 AM
check if string contains numeric, and check string length of numeric value ief@specialfruit.be C++ 5 06-30-2005 01:08 PM



Advertisments