sql server2005 unnecessary characters appended when data retrieved in c#

i have following problem
I enter some data into column of sql server2005 .Then try fetching it using sqlreader in c# using a stored proc.When i try to execute the stored procedure i m getting proper data.
data i m enetring is <table><tr><td><img src="hello.jpg" /></td></tr></table>
and it comes fine when i try in sql server only but when i fetch it in my appliaciton using sqlreader and stored proc.it comes to me as
<table><tr><td><img src=\"hello.jpg\" /></td></tr></table>
So blackslash is getting appended by itself to the double quotes.I am fetching thsi field in string variable
still trying to replace it in code behind using string.replace but it sodesnt allow me to use string.replace("\"",""").
Giving me errors.
can any1 suggest a way that data shud be comming up normaly in c# file than appending these special characters into it.

Thanks
LVL 1
DevsolutionsAsked:
Who is Participating?
 
BurntSkyConnect With a Mentor Commented:
the Replace method creates a new instance of the string with the value removed.  You need to reassign it to your original variable.  Also, you don't need to check if it contains the string first.

EncodedHTML = EncodedHTML.Replace("##linkNewsletter##", "abc");
0
 
BurntSkyCommented:
The string you're viewing is actually correct.  You're probably just looking at it in the debugger; the debugger will show the delimiters on quotation characters, but if you actually display the string to the user in some manner, these delimiters will not be visible.
0
 
DevsolutionsAuthor Commented:
Oh ok,but i am trying to replace the string
encodehtml is having value fetched from database
if (EncodedHTML.Contains("##linkNewsletter##"))
            {
                EncodedHTML.Replace("##linkNewsletter##", "abc");
}
 but its not replacing and going in and then coming out w/o replacing it,dont understand why then,thought this maybe coz i m getting string like that.and probaly probelm is that only
0
 
DevsolutionsAuthor Commented:
HI burntsky.Thanks a lot,yes its working now,
can u please also have a look at another question of mine
http://www.experts-exchange.com/Programming/Languages/.NET/ASP.NET/Q_22708192.html
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.