Hello,
I need to use Update Sql stmt from my page.
Some of the field values has apostrophes and and quotes.
How do I make ado.net ignore those characters?
Eg-
UPDATE ROOM SET HEIGHT='3' - 5"' WHERE RMNU='100'
Iam using c#.
Thanks.
Jay 3 1060
SQL server string literals allow two single quotes (apostrophes) to
represent a single quote. Double quotes don't matter.
So your line should be:
UPDATE ROOM SET HEIGHT='3'' - 5"' WHERE RMNU='100'
"Jay" <pr********@atg inc.com> wrote in message
news:O5******** *****@TK2MSFTNG P09.phx.gbl... Hello,
I need to use Update Sql stmt from my page.
Some of the field values has apostrophes and and quotes.
How do I make ado.net ignore those characters? Eg- UPDATE ROOM SET HEIGHT='3' - 5"' WHERE RMNU='100'
Iam using c#.
Thanks. Jay
Jay,
You can use paramers in the sql query and you can pass whatever the special
characters you want to pass into the SQL query without any problem.
Use SqlCommand or OleDBCommand object and use its parameters collection for
your where clause or SET clause.
Thanks
Nedu
"Jay" <pr********@atg inc.com> wrote in message
news:O5******** *****@TK2MSFTNG P09.phx.gbl... Hello,
I need to use Update Sql stmt from my page.
Some of the field values has apostrophes and and quotes.
How do I make ado.net ignore those characters? Eg- UPDATE ROOM SET HEIGHT='3' - 5"' WHERE RMNU='100'
Iam using c#.
Thanks. Jay
I second that...params are better in every regard that I can think of.
"Nedu N" <ne****@hotmail .com> wrote in message
news:eb******** ******@TK2MSFTN GP12.phx.gbl... Jay,
You can use paramers in the sql query and you can pass whatever the
special characters you want to pass into the SQL query without any problem. Use SqlCommand or OleDBCommand object and use its parameters collection
for your where clause or SET clause.
Thanks Nedu
"Jay" <pr********@atg inc.com> wrote in message news:O5******** *****@TK2MSFTNG P09.phx.gbl... Hello,
I need to use Update Sql stmt from my page.
Some of the field values has apostrophes and and quotes.
How do I make ado.net ignore those characters? Eg- UPDATE ROOM SET HEIGHT='3' - 5"' WHERE RMNU='100'
Iam using c#.
Thanks. Jay
This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: Mosher |
last post by:
Hi all,
I have an issue with php and/or mysql. I have a php form that writes "items"
to a mysql database, including a description of the item. On the mysql
server, "magic_quotes_gpc" is ON.
I am testing it now by putting special characters in the description field,
this is what I am entering:
O'Leary "special edition"
|
by: Egghead |
last post by:
Hi all,
How can I pass special characters into a function, such as :
I want to replace " in mystring
mystring = replace(mystring,"\"","") <--not working
same as in C#
mystring = mystring.Replace("\"", " ")
thanks
|
by: T O |
last post by:
Hi all,
I am very new to C programming and have come across problem.
My programme has opened and created a text document on the hard drive.
The document name is stored in a string called "output".
At the end of the program, I want to open the outputfile.txt
automatically using notepad.
|
by: Jay |
last post by:
Hello,
I need to use Update Sql stmt from my page.
Some of the field values has apostrophes and and quotes.
How do I make ado.net ignore those characters?
Eg-
UPDATE ROOM SET HEIGHT='3' - 5"' WHERE RMNU='100'
|
by: Sakharam Phapale |
last post by:
Hi All,
I am using an API function, which takes file path as an input.
When file path contains special characters (@,#,$,%,&,^, etc), API function
gives an error as "Unable to open input file".
Same file path containing special characters works fine in one machine, but
doesn't work in other.
I am using following API function to get short file path.
Declare Auto Function GetShortPathName Lib "kernel32" (ByVal lpszLongPath As
| |
by: david.lindsay.green |
last post by:
Hello all, I am quite new a web scripting and making web pages in
general and I have stumbled across a problem I have as yet been unable
to solve. I am trying to take the contents of a textarea box and save
it to a file. This step is not to hard however the contents of the
textarea is mostly latex source so it contains just about every special
character you can imagine. My question is this, how do I save an exact
copy of the textarea...
|
by: Trac Bannon |
last post by:
When I load XML from a file into a dotNet XMLDataDocument, the UTF-8 codes
are resolved but the 5 special XML entities are not.
How can I force those 5 special character types to be translated?
|
by: ronrsr |
last post by:
I have an MySQL database called zingers. The structure is:
zid - integer, key, autoincrement
keyword - varchar
citation - text
quotation - text
I am having trouble storing text, as typed in latter two fields.
Special characters and punctuation all seem not to be stored and
retrieved correctly.
|
by: ronrsr |
last post by:
I have an MySQL database called zingers. The structure is:
zid - integer, key, autoincrement
keyword - varchar
citation - text
quotation - text
I am having trouble storing text, as typed in latter two fields.
Special characters and punctuation all seem not to be stored and
retrieved correctly.
|
by: Sobin Thomas |
last post by:
Hi All,
I want to pass a string that contains many special characters (: \ . _
etc) to another page in my website
through query string.
In my project I have a Gridview control ,in which there is a hyperlink
field.The Gridview 's datasource is set as a database table at runtime.The
hyperlink filed's DataNavigateUrlFields is set to "RecordID" ,which is a
field in my database table.The RecordID field contains many special
characters.I...
|
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...
| |
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...
|
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...
|
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...
|
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...
|
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...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
| |
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
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |