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
Office Communication Server 2007 R2 Planning
Folders Hidden windows xp
Open Excel file
How to solve a corrupted Nvidia Driver
gpo is not enforcing control panel settings
Migrating Domain Controller + AD DS from W2k3 to W2K8 R2
Problem with $query - count table elements
2008 TS apps run through 2008 RDS/TS
'Page cannot be displayed' until I hit enter twice
Crystal Report Viewer - Export to/open a PDF after entering parameters