473,407 Members | 2,598 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,407 software developers and data experts.

Error in C# Single Quote

Hello.

I have a problem about single quote search in C#.

I have 1 table:

ID NAME COMPANY
1 Sayre One
1' Sayre Two

In search button

if I will input 1 textbox1.text.replace("'","") the output is:
ID NAME COMPANY
1 Sayre One

if I will input 1' in textbox1.text.replace("'","") the output is:
ID NAME COMPANY
1 Sayre One

I want only the output is the same

1 = 1 Sayre One
1' = 1' Sayre Two

Please Help Me.

Thanks and God Bless

--
To be Happy is To be Yourself
Apr 4 '08 #1
1 2464
Huh?
if I will input 1 textbox1.text.replace("'","") the output is:
.... several compiler errors
1' = 1' Sayre Two
Well, where did Two come from?

You also haven't told us what the textbox has to do with the table. So:
what are you actually trying to do? Perhaps try re-phrasing it?

Marc
Apr 4 '08 #2

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

Similar topics

12
by: Xeon | last post by:
Hi, Is there anyway to set a custom error handler which is actually a method of a class? i.e. setting the method eh() of class foo as error handler in the snippet below. class foo { function...
3
by: Chakkaradeep | last post by:
Hi all, i have a string, str_old="E:\a\b\c.exe", and i want to change to str_new="E:\\a\\b\\c.exe".
2
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...
4
by: andrewcw | last post by:
I am moving some code forward from .NET 1.1. I was able to load the XSL file and perform the transform. The MSDN documentation looks like it should be easy. But I get a compile error. Ideas ?...
21
by: comp.lang.tcl | last post by:
set php {<? print_r("Hello World"); ?>} puts $php; # PRINTS OUT <? print_r("Hello World"); ?> puts When I try this within TCL I get the following error:
6
by: sophia.agnes | last post by:
Dear all, I was going through peter van der linden's book expert C programming there i found the following section on bus error a few years ago bus errors were also generated if a memory...
9
by: Ratfish | last post by:
I'm getting a "2014:: Commands out of sync; you can't run this command now" error on a php page when I try to call a second stored procedure against a MySQL db. Does anyone know why I might be...
1
by: dario90 | last post by:
i have a problem connected with syntax error- in query i have that: SELECT DMax("Data","Pracownicy na stacjach","Lokalizacja stacji = " & & " And Zmiana = " & & " And Data<=#"&Data&"# ") FROM...
7
by: EManning | last post by:
Using A2003. I'm receiving this error when returning from a "DoCmd.OpenReport..." statement. I have a tab control with a subform on every tab. The user selects an item from a combobox at the top...
9
by: gerryR | last post by:
Hi All I've a simple web app that pulls data from an excel sheet into a small aspx page. When I browse the site through VS2005 everything works fine. When I copy the project to IIS wwwroot...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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
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...

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.