insert function val into access db

Please support our VB.NET advertiser: Intel Parallel Studio Home
Reply

Join Date: Apr 2008
Posts: 38
Reputation: q8_dreamy is an unknown quantity at this point 
Solved Threads: 0
q8_dreamy q8_dreamy is offline Offline
Light Poster

insert function val into access db

 
0
  #1
Apr 29th, 2008
hi
i have textbox and i want to insert this text into access db but the field in db is number so i tried both functions val and cint to convert text to integer while iam inserting at the same time but i got error : Input string was not in correct format!

this is my code:

cmcontact.CommandText = "insert into table1_local(id) values" + (Val(Me.TextBox1.Text)) + ";"
Reply With Quote Quick reply to this message  
Join Date: Nov 2007
Posts: 2,641
Reputation: Jx_Man is a glorious beacon of light Jx_Man is a glorious beacon of light Jx_Man is a glorious beacon of light Jx_Man is a glorious beacon of light Jx_Man is a glorious beacon of light Jx_Man is a glorious beacon of light 
Solved Threads: 245
Jx_Man's Avatar
Jx_Man Jx_Man is offline Offline
Posting Maven

Re: insert function val into access db

 
0
  #2
Apr 29th, 2008
why you don't make user to do not input string/char inputs? make them to input numbers only. so you don't have to convert input from text to number.
Never tried = Never Know
So, Please do something before post your thread.
* PM Asking will be ignored *
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:




Views: 1096 | Replies: 1
Thread Tools Search this Thread



Tag cloud for VB.NET
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC