a better aproach would be to use a parameter... (no chance for sql
injection)
SqlCommand cmd = new SqlCommand(connection, "UPDATE dbo.User set name =
@name WHERE id = @id");
cmd.Paramters.Add("@name", "O'Neil");
cmd.Parameter.Add("@id", (int)222);
let the wizard generate some code to persist a dataset (creating a data
adapter) and just go over this code
reards
Christian
>> So, is there any way to write strings that contain apostrophes to a db
>> using
>> SQL statements?
>
> Just replace all instances of a single apostrophe with a double
> apostrophe.