Error in C# Single Quote

  • Thread starter Thread starter Saimvp
  • Start date Start date
S

Saimvp

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
 
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
 
Saimvp said:
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

That output *is* the same.

It would help if you'd show more of your code, and try to explain again
what you're really trying to do. Why are you trying to remove the
single quote in the first place?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top