Click here to Skip to main content
15,890,438 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
hello

i have a problem in single quote , when i am sending a string type of data to a database

like "I am 'ASP' Developer"

it is inserting successfully

but

when i want to show this in a gridview it is showing differently like :-

I am 'ASP' Developer.

' :- it is coming for single quote

& :- it is for double quote


when inserting data from textbox to database it is not showing any problem but when inserting data from gridview to database it is inserting in format.

is there any solution to show that single quote and double quote.
Posted
Updated 23-Aug-13 19:43pm
v2
Comments
Mahesh Bailwal 24-Aug-13 1:49am    
Please share your code where you are facing problem.
Jimut123456789 24-Aug-13 2:18am    
i am uploading the data from excel sheet to grid view and in grid view it is coming in well format but when i am sending the data from grid view to database the single quote, ampersand , double quote means special character convert to html format.

i have converted like :-
string MaterialDescription = gvr.Cells[10].Text.ToString();

1 solution

You can use WebUtility.HtmlDecode in this case
string MaterialDescription = System.Net.WebUtility.HtmlDecode(gvr.Cells[10].Text.ToString());


WebUtility.HtmlDecode Method[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900