Microsoft
Software
Hardware
Network
Question : Replace apostrophes in all Session Variables in C#?
Having a bit of trouble here...
Can someone provide some code to loop through all active Session variables and replace any single apostrophes with double apostrophes so that I can insert cleanly into SQL database?
Thanks!
Answer : Replace apostrophes in all Session Variables in C#?
try
foreach (string key in Session.Keys) {
Session[key].ToString() = Session[key].ToString().Re
place("'",
"''");
}
Random Solutions
hide a Div
advance image editing via the web
Duplex print pdf files
Checking ASP variable for nulls
ssis package issue
Exporting variables from module on windows
Custom Javascript in Head tag of each Wordpress Page without using Headspace
Lightbox problem in asp.net/vb.net
outlook 2007 crashing upon start
Office 2003 and 2007 printing problem