7 VB.NET Articles - Fix the SQL Single quote problems in SQL in vb.net
Viewing Article

Current Rating :

Fix the SQL Single quote problems in SQL in vb.net

Wednesday, February 09, 2011Posted by admin

Category:vb.Net Utilities
 

When the sql contains the single quotes then they have to be properly escaped otherwise it will give errors just pass the field value which you want to check and the following function will return you the properly escaped string. eg. o’brien will be returned as o”brien and this will not cause your sql to break. Function FixSql(ByVal sStr As String) As String FixSql = Replace(sStr, “‘”, “””) End Function

Hits:385      Current Rating :      No Of Ratings: 40      AuthorName: admin
  

Comment#23      Friday, February 11, 2011          Posted by Sumeet Singh

 
Hi this site is really great

Comments

Your Name  
 
Your Email( will not appear on page)  
Your Comments