[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

microsoft.public.dotnet.framework.odbcnet

class or method to escape special chars

deutronium

12/19/2002 3:52:00 PM

is there a method or a class to escape special chars in strings?
i have textboxes in my app where the user can enter any string. these string
a later use in a db-query.

OdbcCommand myComm = new OdbcCommand
("select * from Table where aName=' "+name+" ' ", odbcConn);

the problem now is when the entered string contains " or ' or \ or _ or %.
then i get errors from the database. is there a method to escape these
chars?