Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Format a string with escape characters

Status
Not open for further replies.

ProfReynolds

Programmer
Sep 12, 2001
96
US
Is there a way to take a string and format it such that it will be accepted in a SQL XML cell?

I had thought that httpUtility.HTMLEncode would do the trick, but it doesn't quite handle it.

Thanks!
 
There is a SqlDbType.Xml enumeration. try setting the type to this and assign the value.

in terms of building the xml string fro sql, that you will probablly need to design on your own.

Jason Meckley
Programmer
Specialty Bakers, Inc.
 
Thanks.

I ended up using Cast(string as xml) in the Insert statement.

Thanks for your help!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top