473,385 Members | 1,606 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,385 software developers and data experts.

Error converting varchar to numeric

22
I check my database and all data types are correct
Expand|Select|Wrap|Line Numbers
  1.  conn = GetConnect()
  2.  
  3.         Dim mycommand As SqlClient.SqlCommand = New SqlClient.SqlCommand()
  4.         mycommand.Connection = conn
  5.         mycommand.CommandText = "Update Tbl_Member_Profile set F_Name='@F_Name', M_Name='@M_Name', L_Name='@L_Name', Date_Of_Birth='@Date_Of_Birth', Membership_Category='@Membership_Category', Age='@Age', F_Recruiter_Member_Code='@F_Recruiter_Member_Code', Credit_Rating='@Credit_Rating', Credit_Line='@Credit_Line', Credit_Limit='@Credit_Limit', Member_Photo_Data='@Member_Photo_Data' WHERE P_Member_Code='@P_Member_Code'"
  6.         conn.Open()
  7.  
  8.         Try
  9.  
  10.             mycommand.Parameters.Add("@F_Name", SqlDbType.VarChar).Value = txt_F_Name.Text
  11.             mycommand.Parameters.Add("@M_Name", SqlDbType.VarChar).Value = txt_M_Name.Text
  12.             mycommand.Parameters.Add("@L_Name", SqlDbType.VarChar).Value = txt_L_Name.Text
  13.             mycommand.Parameters.Add("@F_Recruiter_Member_Code", SqlDbType.Decimal).Value = TXT_rec_no.Text
  14.             mycommand.Parameters.Add("@Credit_Rating", SqlDbType.Char).Value = txt_ranking.Text
  15.             mycommand.Parameters.Add("@Membership_Category", SqlDbType.Int).Value = txt_membership.Text
  16.             mycommand.Parameters.Add("@Credit_Line", SqlDbType.Decimal).Value = txt_cre_line.Text
  17.             mycommand.Parameters.Add("@Credit_Limit", SqlDbType.Decimal).Value = txt_max_cre.Text
  18.             mycommand.Parameters.Add("@Date_Of_Birth", SqlDbType.DateTime).Value = datepicker.Value.Date
  19.             mycommand.Parameters.Add("@Age", SqlDbType.Int).Value = txt_age.Text
  20.             mycommand.Parameters.Add("@Member_Photo_Data", SqlDbType.Image).Value = imgByteArray
  21.             mycommand.Parameters.Add("@P_Member_Code", SqlDbType.Decimal).Value = txt_Cus_No.Text
  22.             mycommand.ExecuteNonQuery()
  23.             MsgBox("Success")
  24.         Catch ex As System.Data.SqlClient.SqlException
  25.             MsgBox(ex.Message)
  26.         End Try
Thanks in advance
Apr 21 '14 #1
1 1826
mcupito
294 256MB
Which fields in the database are numerics? Let's start there.
Apr 24 '14 #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...
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...
1
by: ronca | last post by:
Error Syntax error converting the varchar value $568.25 to a column of data type Statement I'm using Select Top 1000 * From mass.dbo.dbo_MASS where _amount > 5000 Want only row with _amount...
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...
4
by: darrel | last post by:
I'm getting this error: Arithmetic overflow error converting numeric to data type numeric. Triggered on this line of my code: objOleDbAdapter.Fill(DS, "rss") Everything works when this is...
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, ...
5
AAPWM
by: AAPWM | last post by:
Hello My job is to extract data from my companies database with Crystal Reports, export that data to Excel, modify the data, save the data as "Text "tab delimited"", and upload to the database...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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...

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.