473,320 Members | 2,080 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,320 software developers and data experts.

Error converting data type varchar to tinyint

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 giving it a varchar input - right?

If that's so - there's only one field in the table that uses tinyInt - and
I've double checked:

cmd.Parameters.Add(New OleDbParameter("@idMarketingRepType",
OleDbType.TinyInt))
cmd.Parameters("@idMarketingRepType").Value = intMktgType ' <-------this is
DEFINITELY an 8

With 7 insertable fields:
1 is a SmallInt
1 is a TinyInt
2 are varchars
3 are Bit fields (because of using a UDL for the conn string, I'm having to
use OleDB instead of the SQL client, so I'm using this format:

cmd.Parameters.Add(New OleDbParameter("@Percent_Yn", OleDbType.BSTR))
cmd.Parameters("@Percent_Yn").Value = intCommissionType

Another question - since these values are bits (-1 or 0) - when I dim the
datatype for these - I've been using Integer
I assume that's ok here -

the whole parameter section is here:
cmd.Parameters.Add(New OleDbParameter("@idEmployee", OleDbType.SmallInt))
cmd.Parameters("@idEmployee").Value =System.DBNull.Value ' I've tried
leaving this out completely since it's always null

cmd.Parameters.Add(New OleDbParameter("@idMarketingRepType",
OleDbType.TinyInt))
cmd.Parameters("@idMarketingRepType").Value = intMktgType

cmd.Parameters.Add(New OleDbParameter("@RepID", OleDbType.varchar,10))
cmd.Parameters("@RepID").Value = txtRepID.text

cmd.Parameters.Add(New OleDbParameter("@RepName", OleDbType.varchar,42))
cmd.Parameters("@RepName").Value = txtRepName.text

cmd.Parameters.Add(New OleDbParameter("@Percent_Yn", OleDbType.BSTR))
cmd.Parameters("@Percent_Yn").Value = intCommissionType

cmd.Parameters.Add(New OleDbParameter("@AutoRecalc_Yn", OleDbType.BSTR))
cmd.Parameters("@AutoRecalc_Yn").Value = System.DbNull.Value ' I've
tried leaving this out completely since it's always null

cmd.Parameters.Add(New OleDbParameter("@Active_Yn", OleDbType.BSTR))
cmd.Parameters("@Active_Yn").Value = intActive

I've verified all field inputs using Tracing - and if I use an inline sql
statement with hardcoded numbers, it works find.
Any ideas here, on what could be wrong?
Mar 29 '06 #1
0 1933

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

12
by: Nohman Ishtiaq | last post by:
MySQL 4.1 Im not very well versed with databases, but as soon as I include 129th row in my table called 'demainpark', I get Table is Full error. I have searched thru the newsgroup, checked the...
1
by: Jay | last post by:
I hope this is the correct place to post this. I'm using a stored procedure to simply look up and return a value from a database. The db key is an integer, everything else is varchar. The stored...
0
by: Smriti Dev | last post by:
Hi, I have a ms access table table which is linked to a mysql database table. I have used a ms access form to edit records. However, when I attempt to edit a record I get a write conflict error...
4
by: Viktor Popov | last post by:
Hi, I'm trying to execute stored procedure and I collect its parameters from WebForm. There is an error: Error converting data type varchar to int. What could be the problem? Here it is the...
2
by: Leon Shaw | last post by:
Please help me understand this Error??? Server Error in '/solo' Application. ---------------------------------------------------------------------------- ---- Object must implement...
7
by: Leon Shaw | last post by:
Need help understanding? Server Error in '/solo' Application. ---------------------------------------------------------------------------- ---- Object must implement IConvertible....
16
by: Viktor Popov | last post by:
Hi, I'm trying to execute stored procedure and I collect its parameters from WebForm. There is an error: Error converting data type varchar to int. What could be the problem? Thanks! Here it...
6
by: ~Maheshkumar.R | last post by:
The error i'm getting is as: > Server Error in '/' Application. > -------------------------------------------------------------------------- -- > String or binary data would be truncated. The...
13
by: dbuchanan | last post by:
Hello, Here is the error message; ---------------------------- Exception Message: ForeignKeyConstraint Lkp_tbl040Cmpt_lkp302SensorType requires the child key values (5) to exist in the...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.