a = a.Replace("'","''")
不过最好用insert into table (a,b) values (@a,@b)
用参数形式传进去。