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
Asterisk DialPlan issue
Bang for the Bucks
Linux Transfer Script
Microsoft Word 2007 - Logo in header I don't want printed
Access 2003 continuous tabular form question
How do I copy files?
Connecting to a Window Server 4.0 domain with a Windows 7 workstation
Is it safe to move Exchange log files to another drive directory?
Global Error Handler and On Error Resume Next
Can Sharepoint 2010 do this?