Last post Sep 26, 2014 05:24 AM by Kevin Shen - MSFT
Sep 25, 2014 07:51 AM|bipulkumars|LINK
How do I insert single quotes (Don't) in the entity framework-migration script
const string Query = @"SET IDENTITY_INSERT Tab ON insert into Employee (Id,Name,[Order]) values (0, 'Don't know',0)";
I tried using double single quotes (Don''t) but on Update-Database i am getting "String or binary data would be truncated. The statement has been terminated."
Thanks in advance.
Sep 25, 2014 11:14 AM|Dr. Acula|LINK
did you try backslash?
Sep 26, 2014 05:24 AM|Kevin Shen - MSFT|LINK
thanks for your post here.
please try the code below:
const string Query = @"SET IDENTITY_INSERT Tab ON insert into Employee (Id,Name,[Order]) values (0, 'Don''t know',0)";
You can also refer to the similar issue: