473,511 Members | 15,197 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How can I use single quote as litral in my code passing sql statement?

6 New Member
The code is as follows
dim st as string
st="select * from employees where empName='" & textName.Text &"'"
' The empName is Dani'e
'So the single quote with in the name Dani'e makes the vb.net code to halt.??????
'How can I pass???
Thanks in advance.
May 2 '11 #1
3 2072
Rabbit
12,516 Recognized Expert Moderator MVP
You need to replace the singles quotes with two single quotes
May 2 '11 #2
Yemata Abebe
6 New Member
Oh Not works!
Remember the single quote (') is enterd from the user front end.
May 6 '11 #3
Rabbit
12,516 Recognized Expert Moderator MVP
Yes, it's input by the user on the front end. But you need to replace it with two single quotes in your query string.
May 6 '11 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

4
10617
by: sankofa | last post by:
hi, i can't seem to be able to escape my single quote properly... is it even possible in javascript? this is a portion of my code.. var DLEWIS="Pastor Lewis"; .... Sermon is a yser-defined...
1
2528
by: Vivek | last post by:
hi, I've an xml like this.. <REPORT> <ITEM name="Children's hospital"/> <ITEM name="AJ Hospital"/> </REPORT> I tried the following xpath to find the node... XMLDoc.Load (--load above xml--);...
3
3094
by: Jason | last post by:
I have several tables with quite a few fields and I'm getting errors when trying to insert records with single quotes in the data like: name = John O'Henry or a city name of O'Fallen So I went...
4
1629
by: Paul | last post by:
I've got some code that adds a single quote to any ad hoc queries that appear to look like hacks. For instance, if somebody enters ' OR 1=1 -- then this code adds another single quote the string...
4
5594
by: Jack | last post by:
Hi, I have a asp page where part of the code is as follows. This builds up the sql statement partially. sql01 = "UPDATE EquipmentTbl SET " sql01 = sql01 & "SerialNumber = '" &...
3
1194
by: Wayne Wengert | last post by:
I am trying to build a list of href statements that include parameters as in the following code: Response.Write("<td align='center'><a href='YTDDetails1.asp?jname=" & aryRslt(0,i) & "&jclass=" &...
2
2132
by: Anonieko | last post by:
Hello ASPNET guru's, What is a clean way to go around the problem of displaying a GridView templated column where data can contain Single Quote ( ' )? I maybe too naive, but this is of course...
3
2726
by: Eric Layman | last post by:
Hi, I've saved data into the db by doing a replace() on single quote. Right now on data display on a datagrid, it shows double single quote. How do I make changes during run time of datagrid...
0
2102
by: dhascuba | last post by:
The @name field can contain a single quote in it such as: Mike O'Grady. Since this is creating and SQL statement on the server side, it will not process the name if it has a single quote in it. Id'...
2
5856
by: p4willi | last post by:
I have an unbound text box called Notes on a MS Access 2007 form with the Text Format property set to Rich Text. The underlying database has a Memo field called NOTES with it's property set to...
0
7237
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,...
0
7417
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...
1
7074
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
7506
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...
1
5063
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
3219
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...
0
1572
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 ...
1
780
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
445
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...

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.