473,396 Members | 1,866 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Error converting data type varchar to numeric.

I am getting the error Error converting data type varchar to numeri when trying to save some of the information that is entered in a textbox to my sql server 2005 database. HEre is the code for my insert statement. Any help is appreciated.
Thanks,

Matt

Expand|Select|Wrap|Line Numbers
  1. 'declare your variables
  2.     Dim FirstName, LastName, Comments, MRN
  3.     Dim sConnString, connection, sSQL
  4. 'Receiving values from Form, assign the values entered to variables
  5.     FirstName = Request.Form("FirstName")
  6.     LastName = Request.Form("LastName")
  7.     Comments = Request.Form("Comments")
  8.     MRN = Request.Form("MRN")
  9. 'declare SQL statement that will query the database 
  10.     sSQL = "INSERT into tblPatientInfoTest (FirstName, LastName, Comments, MRN) values ('" & _
  11. FirstName & "', '" & LastName & "', '" & Comments & "', '" & MRN & "')"
  12.  
Aug 12 '10 #1

✓ answered by MrMancunian

Are the fields in the database declared as varchar? You're inserting stringvalues (although not explicitly casted), so that should match your database types.

Steven

1 3942
MrMancunian
569 Expert 512MB
Are the fields in the database declared as varchar? You're inserting stringvalues (although not explicitly casted), so that should match your database types.

Steven
Aug 13 '10 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: jaYPee | last post by:
I have created a stored procedure that contain this field (below) in order to meet certain criteria. But my problem is when I try to run the stored procedure I encounter an error "Error converting...
1
by: luna | last post by:
got so far then it broke and i cant get it working again - it was updating fine but not inserting and now im getting a "Error converting data type varchar to numeric" which i didnt have before.......
0
by: rajmgopal | last post by:
Hello Everyone I am getting the following error when i try to insert a record into Sql Server 2005 from my VB 2005 application. sqlEx = {"Error converting data type numeric to numeric."} I...
0
by: Elmo Watson | last post by:
I am having all kinds of problems with a Stored Proc I'm trying to run, with the error I'm getting above. First - the way I'm reading it - the database EXPECTS a TinyInt - and it thinks I'm...
2
by: Curious Trigger | last post by:
Hello, if have an asp.net web page with a detailsview. This detailsview uses a sqldatasource connecting to a sql server 2005 database with a select statement simliar to this one: SELECT...
0
by: Adele | last post by:
Please help, I'm new to SQL and I use a script to import data and when I tried importing data tonight it gave me "error converting data type nvarchar to float". I have no idea what this error...
0
by: jjtechy | last post by:
The data like 0.06234 that is imported from another server is getting changed as 6.234....E-2 in my local.it is looking as 0.06234 in that server.The datatype of that column is varchar(50) in both...
0
by: bluepiper | last post by:
Hi everyone. I have created a linked server on SQL Server 2005 to access data from visual foxpro database. I execute a query Select * from OpenQuery(members, 'Select * from memfile') but Im...
0
by: guest1 | last post by:
seems to be a problem in my first case stmt here i need to convert this and i dont know how, hope somebody can help me out select distinct top 10 tplan.plan_long_nm, asset.ast_cntr_pol_num,...
3
by: lornab | last post by:
Hi I wonder if anyone can help - I think the answer is simple but it's been a really long day and I need to get this done!! My select statement goes like this... SELECT client, ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.