473,785 Members | 2,746 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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( "@idMarketingRe pType",
OleDbType.TinyI nt))
cmd.Parameters( "@idMarketingRe pType").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_Y n", OleDbType.BSTR) )
cmd.Parameters( "@Percent_Yn"). Value = intCommissionTy pe

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( "@idEmploye e", OleDbType.Small Int))
cmd.Parameters( "@idEmployee"). Value =System.DBNull. Value ' I've tried
leaving this out completely since it's always null

cmd.Parameters. Add(New OleDbParameter( "@idMarketingRe pType",
OleDbType.TinyI nt))
cmd.Parameters( "@idMarketingRe pType").Value = intMktgType

cmd.Parameters. Add(New OleDbParameter( "@RepID", OleDbType.varch ar,10))
cmd.Parameters( "@RepID").V alue = txtRepID.text

cmd.Parameters. Add(New OleDbParameter( "@RepName", OleDbType.varch ar,42))
cmd.Parameters( "@RepName").Val ue = txtRepName.text

cmd.Parameters. Add(New OleDbParameter( "@Percent_Y n", OleDbType.BSTR) )
cmd.Parameters( "@Percent_Yn"). Value = intCommissionTy pe

cmd.Parameters. Add(New OleDbParameter( "@AutoRecalc_Yn ", OleDbType.BSTR) )
cmd.Parameters( "@AutoRecalc_Yn ").Value = System.DbNull.V alue ' 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").V alue = 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 1975

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

Similar topics

12
8583
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 full_table info on MySQL Docu, also looked at the Documetation but couldnt come up with an answer to my problem: Here is my my.ini file:
1
1873
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 proc is: CREATE procedure SP_IMAGE_NAME( @MAT_ID varchar(13), @TYPE varchar(1), @IMAGE_NM varchar(100) OUTPUT ) as
0
2338
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 in ms access. I am using MS ACCESS 2002. The error is 'the record has been changed by another user since you started editi it. If you save the record, you will overwrite the changes the other user made'. The Save record button is greyed out so I...
4
1618
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 code: private void Button2_Click(object sender, System.EventArgs e) {
2
1942
by: Leon Shaw | last post by:
Please help me understand this Error??? Server Error in '/solo' Application. ---------------------------------------------------------------------------- ---- Object must implement IConvertible. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
7
1670
by: Leon Shaw | last post by:
Need help understanding? Server Error in '/solo' Application. ---------------------------------------------------------------------------- ---- Object must implement IConvertible. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
16
1250
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 is the code: private void Button2_Click(object sender, System.EventArgs e) {
6
3350
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 statement has been > terminated. > Description: An unhandled exception occurred during the execution of the > current web request. Please review the stack trace for more information
13
10147
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 parent table. ----------------------------
0
9643
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9480
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10319
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8971
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5380
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5511
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4046
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3645
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2877
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.