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
PC Policy for Windows 7
livehttpheaders.mozdev.org
legitimate site or not?
Summing values based concatenated date and variable
Update field in table with unbound field on form.
Powershell script to export info from AD
In an SQL Server Stored Procedure, how do I declare a cursor using a Where clause passed in as a parameter?
c# .net - get command line argument on form load
Hide/show button depending of if textbox has text or not with jQuery?
How can I have multiple buttons in HTML that POST to PHP?
Copy & paste document in a view