i am having problem.. i am using mysql with my c# application and.. in my string i get apostrophe ' .
for example : this is his brother's book.
i want to save this sentense in my mysql data with c# when i remove the apostrophe and try to save that in the database it works fine. but when i use this one it gave me error.. so can anybody tell me that how can i save this apostrophe in the database.
Sheikhans
Member
47 Points
85 Posts
How to Save apostrophe ' in mysql using C#
Nov 08, 2012 06:30 AM|LINK
hi.
i am having problem.. i am using mysql with my c# application and.. in my string i get apostrophe ' .
for example : this is his brother's book.
i want to save this sentense in my mysql data with c# when i remove the apostrophe and try to save that in the database it works fine. but when i use this one it gave me error.. so can anybody tell me that how can i save this apostrophe in the database.
your help will be truely appricatied.
Thanks.
Ans.
pradeep shar...
Contributor
4004 Points
763 Posts
Re: How to Save apostrophe ' in mysql using C#
Nov 08, 2012 06:42 AM|LINK
use '' like this
inset into abc values ('I''m')
Sheikhans
Member
47 Points
85 Posts
Re: How to Save apostrophe ' in mysql using C#
Nov 08, 2012 06:51 AM|LINK
i did like this .. when i export the mysql data in the csv back. then it shows me this ’ instead of showing apostrophe.
so can you tell me tha where do i make change in mysql that it show the proper data in the csv as it shows in the database
Thanks
Ruchira
All-Star
44216 Points
7184 Posts
MVP
Re: How to Save apostrophe ' in mysql using C#
Nov 11, 2012 05:31 AM|LINK
Hello,
Store it precede with backslash, like below
this is his brother\'s book
My Tech blog | My YouTube ChannelPlease 'Mark as Answer' if this post helps you.