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

Special Character Conversion

Hi Guys!!!
i'm newbie to asp.net 2.0. i've got a problem. i've a textfield on my
webpage and if i insert " can't " or " test - test " value into it and
post it back the " ' " and " - " get converted into the blocks and i
got a procedure to store them into the SQL server 2000 database where
the field has varchar type. while it gets stores, it gets converted
into the " ? ". so it reads like " can?t " and " test?test ". i dont
know where is the conversion occured.

i've check almost all the possiblities of datatype missmatch in the
procedure and the data column in the database but nothing seems
working.

i've same problem with the NVARCHAR data type field also.

please help me out to locate this problem. i'm not able to understand
what's wrong with this things.

thanks in advance.

Lucky

Mar 21 '06 #1
4 1694
When you execute your stored proc to store the values, are you using
the SqlCommand.Parameters collection to set stored proc parameters or
are you executing a SqlCommand by setting the CommandText to something
like "exec spUpdateValue 'can't' ".

Using the Parameter's collection ADO.net will properly esacape
characters like '. The above exec line won't run because you must
prefix a single quote with another single quote as "exec spUpdateValue
'can''t' "

I've never seen a "-" being converted like that. ADO might think
you're trying to refer to a column called "test".

Mar 21 '06 #2
i\m not sure about ado.net behaviour. i\m using SqlParamaters to pass
the values so i dont think it should manipulate the values.

may be when i\m posting back the values to the server that time they
are getting replaced coz i checked for the character and it has
recognized " ' " as control character.
still wondering where it the fault

Mar 21 '06 #3
Can you post some of the ASP.NET code that calls the stored proc and
and the stored proc definition itself?

Mar 21 '06 #4
Thus wrote Lucky,
Hi Guys!!!
i'm newbie to asp.net 2.0. i've got a problem. i've a textfield on
my
webpage and if i insert " can't " or " test - test " value into it and
post it back the " ' " and " - " get converted into the blocks and i
got a procedure to store them into the SQL server 2000 database where
the field has varchar type. while it gets stores, it gets converted
into the " ? ". so it reads like " can?t " and " test?test ". i dont
know where is the conversion occured.
Are these really the basic apostrophe and hyphen/minus, or some Unicode characters
like ’ or —? The latter cannot be stuffed in a varchar.

i've check almost all the possiblities of datatype missmatch in the
procedure and the data column in the database but nothing seems
working.

i've same problem with the NVARCHAR data type field also.

please help me out to locate this problem. i'm not able to understand
what's wrong with this things.


You may also lose them due to the wrong request encoding. Are you posting
from an ASP.NET page or some other page (ASP, PHP, plain HTML)? What requestEncoding
have you set in web.config?

Cheers,
--
Joerg Jooss
ne********@joergjooss.de
Mar 21 '06 #5

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

Similar topics

7
by: Roy W. Andersen | last post by:
I've been searching google about this for days but can't find anything, so I'm hoping someone here can help me out. I'm trying to create zip-files without needing the zip-file extension in PHP,...
5
by: Matthew Shaw | last post by:
We have a web-based reporting application written in J2EE that writes out to excel using response.setContentType ("application/vnd.ms-excel; ")…. The problem is that where we have any special...
3
by: ATH0 | last post by:
How to search for special character { } and how to count them.. I got field called text ( undefined length ) and in this field you must define "{" as start and "}" as end of some text line. If...
23
by: Akhil | last post by:
Since a character constant is an int value represented as a character in single quotes,so it is treated as a 1 byte integer now look at the following snippet. #include<stdio.h> int main(void)...
5
by: Doc | last post by:
Hello! I'm experiencing a little problem counting the number of characters in a textarea on a html page. This is the content type of my HTML document content="text/html; charset=iso-8859-1" ...
8
by: abhi147 | last post by:
Hi , I have been trying to convert a 32 bit string like "b2a4fdf15af7c4f215e1909be4707bdb" to convert to a string of special chars like "²¤ýñZ÷Äòá?›äp{Û" I have tried a lot of things .. but...
25
by: Wim Cossement | last post by:
Hello, I was wondering if there are a few good pages and/or examples on how to process form data correctly for putting it in a MySQL DB. Since I'm not used to using PHP a lot, I already found...
3
KevinADC
by: KevinADC | last post by:
Purpose The purpose of this article is to discuss the difference between characters inside a character class and outside a character class and some special characters inside a character class....
3
by: Klaus Herzberg | last post by:
Hi, I come from the "dark side" php/mysql and there often problems with character sets (utf-8, latin...) and storing data in datebase. Exists in the world of dot.net and ms-sql-server similiar...
9
by: TP | last post by:
Hi everybody, I am new to Python, I try to understand how Python treats special characters. For example, if I execute the following line in a shell console, I obtain a colored string: $...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
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,...
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...
0
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...
0
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...

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.