Microsoft SQL Server
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsDatabaseMicrosoft SQL Server

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
  #1  
Old September 19th, 2003, 12:51 AM
Anitha Anitha is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Aug 2003
Posts: 8 Anitha User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
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

Reply With Quote
  #2  
Old September 20th, 2003, 10:11 AM
unatratnag unatratnag is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Aug 2003
Posts: 312 unatratnag User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 8 m 6 sec
Reputation Power: 6
Send a message via AIM to unatratnag
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.

Reply With Quote
  #3  
Old October 10th, 2004, 08:23 AM
subchaser subchaser is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Oct 2004
Posts: 1 subchaser User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
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'

Reply With Quote
Reply

Viewing: ASP Free ForumsDatabaseMicrosoft SQL Server > Handling Special character before inserting through XML (In Asp .Net)


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway