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

Type Mismatch Error(numeric values)

i have 3 columns in sql server ..

all of them are numeric value

when a user enter my site i take the value of userid (numeric one) i assign
it as session("userid ")

after a query i take 2 value (both numeric again) from my table and write
this code

if towhom=session("userid") then towhom=fromwhom

it gives an error .. how can i solve it

Type Mismatch Error
Jul 19 '05 #1
3 2171
Have you tried casting your values to the same datatype?

If CInt(towhom) = CInt(Session("UserID"))...

Ray at work

"Savas Ates" <sa***@indexinteractive.com> wrote in message
news:ue*************@TK2MSFTNGP09.phx.gbl...
i have 3 columns in sql server ..

all of them are numeric value

when a user enter my site i take the value of userid (numeric one) i
assign
it as session("userid ")

after a query i take 2 value (both numeric again) from my table and write
this code

if towhom=session("userid") then towhom=fromwhom

it gives an error .. how can i solve it

Type Mismatch Error

Jul 19 '05 #2
Ray,

Casting into String is the best option, since other cast functions give
errors if the input is not numeric (e.g. empty)

If CStr(towhom) = CStr(Session("UserID")) Then...

--
Manohar Kamath
Editor, .netWire
www.dotnetwire.com
"Ray Costanzo [MVP]" <my first name at lane 34 dot commercial> wrote in
message news:%2****************@TK2MSFTNGP14.phx.gbl...
Have you tried casting your values to the same datatype?

If CInt(towhom) = CInt(Session("UserID"))...

Ray at work

"Savas Ates" <sa***@indexinteractive.com> wrote in message
news:ue*************@TK2MSFTNGP09.phx.gbl...
i have 3 columns in sql server ..

all of them are numeric value

when a user enter my site i take the value of userid (numeric one) i
assign
it as session("userid ")

after a query i take 2 value (both numeric again) from my table and write this code

if towhom=session("userid") then towhom=fromwhom

it gives an error .. how can i solve it

Type Mismatch Error


Jul 19 '05 #3
Good point.

Ray at work

"Manohar Kamath" <mk*****@TAKETHISOUTkamath.com> wrote in message
news:e9*************@TK2MSFTNGP11.phx.gbl...
Ray,

Casting into String is the best option, since other cast functions give
errors if the input is not numeric (e.g. empty)

If CStr(towhom) = CStr(Session("UserID")) Then...

Jul 19 '05 #4

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

Similar topics

2
by: noname | last post by:
How do I display a "0" instead of it returning "#ERROR" in a query where I have division. Also have negative numbers returned on some values, but want "0" displayed on them also.
2
by: foldface | last post by:
Hi Pardon the vague-ness, I mean the ?name=value stuff in the URL. Can you set this within javascript on a page such that when an asp.net button is clicked then these values are passed as params?...
4
by: clayne | last post by:
I realize this may work for the majority of platforms. But I am concerned about the aspects of sign extension and portability. Is this portable: { unsigned long bw; if ((signed long)(bw...
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...
8
by: pozz | last post by:
In my software, there are some variables that represents some settings. They usually are numerical variables: unsigned char (0..255), signed char (-127..128), unsigned int (0..65535), signed int...
1
by: syang8 | last post by:
I want to declare a function F() in a class, which has two children A and B. I need A.func() return int and B.func() return double. How can I do that? The F() in parent can be empty or virtual, I...
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...
1
by: sonata | last post by:
I am trying to compare two fields which are char data typr. BUT the comparision must be arithemetic in nature. so i tried to cast both the data base field and my parameter field to big int...
5
by: =?Utf-8?B?amlt?= | last post by:
If I assign an attribute using property name/value pairs such as where stringVal is a string C# generates the name\value pair using hex values 01 00 01 00 54 0E 09 73 74 72 69 6E 67 56 61 6C 03...
0
by: abbasky | last post by:
### Vandf component communication method one: data sharing ​ Vandf components can achieve data exchange through data sharing, state sharing, events, and other methods. Vandf's data exchange method...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: fareedcanada | last post by:
Hello I am trying to split number on their count. suppose i have 121314151617 (12cnt) then number should be split like 12,13,14,15,16,17 and if 11314151617 (11cnt) then should be split like...
1
by: davi5007 | last post by:
Hi, Basically, I am trying to automate a field named TraceabilityNo into a web page from an access form. I've got the serial held in the variable strSearchString. How can I get this into the...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....
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: Aftab Ahmad | last post by:
Hello Experts! I have written a code in MS Access for a cmd called "WhatsApp Message" to open WhatsApp using that very code but the problem is that it gives a popup message everytime I clicked on...
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...

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.