473,946 Members | 1,700 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 2212
Have you tried casting your values to the same datatype?

If CInt(towhom) = CInt(Session("U serID"))...

Ray at work

"Savas Ates" <sa***@indexint eractive.com> wrote in message
news:ue******** *****@TK2MSFTNG P09.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("U serID")) Then...

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

If CInt(towhom) = CInt(Session("U serID"))...

Ray at work

"Savas Ates" <sa***@indexint eractive.com> wrote in message
news:ue******** *****@TK2MSFTNG P09.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*****@TAKETH ISOUTkamath.com > wrote in message
news:e9******** *****@TK2MSFTNG P11.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("U serID")) Then...

Jul 19 '05 #4

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

Similar topics

2
1552
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
2144
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? On a side note, whats the earliest place on a page where some form of text from the client could be passed back to the asp.net page, i.e. a "<input type=hidden>" element can have its text read in Page_Load, is there anything which could be...
4
1761
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 = read(s, buf, sizeof(buf))) == -1) {
0
2434
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 checked for possible overflow exception, but did not encounter any. I have declared the values that i am trying to insert as DECIMAL data types in my VB code.
8
1846
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 (-32767..32768). I want to write a generic C function that changes the value of one parameter. For example, a function that takes a pointer to the variable and increments it by one. Of course, the function doesn't know the variable type (unsigned...
1
1369
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 just need the declaration. No implementation is required.
4
7635
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 pointed at one DB server (our staging server) but when we point it at another DB server (our production server) I get the error.
1
18898
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 types which failed. I tried for Decimal type conversion and then comparision. It gave me the above error.
5
2230
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 6A 6F 65. I've determined 54 is a delimiter between properties and the next value OE represents the string type. Is there a complete table of hex values and their map to all the types or a particular System.Type method I could use to get this...
0
10151
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
9979
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
11556
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
11150
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
11333
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10685
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7412
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
6111
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
6327
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

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.