|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Handling Special character before inserting through XML (In Asp .Net)
Hi
To convert the Special character i am using htmlencode but it is not handling the Single Apostropes For eg: Dim strremarks = server.HtmlEncode(txtsample.text.trim) if the Txtsample.value='Anit'ha' how to handle this |
|
#2
|
|||
|
|||
|
yea, welcome to ASP, you'll have to manually search the string and replace it with & keyname; I can't think of the keyname for ' at the current moment though sadly enough. also have you tried replacing it with \' not sure if that will cause SQL to not interpret it but give it a shot i say.
|
|
#3
|
|||
|
|||
|
Replace all the single quotations with double quotations, eg strremarks = replace(strremarks,"'","''")
Sql will interpret the double quotations correctly without causing an error, and will read them out correctly in HTML and XML. Stored in DB as 'Anit''ha'' outputted as 'Anit'ha' |
![]() |
| Viewing: ASP Free Forums > Database > Microsoft SQL Server > Handling Special character before inserting through XML (In Asp .Net) |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|