when am entry i don't luve u.it gives run time error .that
Incorrect syntax near 't'.
Unclosed quotation mark after the character string ''.
cmd = new SqlCommand("Select distinct hallcode from Det_movie where Flag='Y' and MovieName='" + movie + "'", con);
i think problem arises becz of whe it matches the movie name it get a extra ' within sring(don't)
in MovieName='" + i don't+ "'"
so problem arise how to overcome this problem


Praveen KumarRank #4 · 79.9K reputationPosted May 17, 2013, 9:59 PM EDT
You have to escape it by doubling it like this:
insert into movie values ('i don''t luve u')
Bhabani prasad Dash168 reputationPosted May 17, 2013, 10:02 PM EDT
Praveen KumarRank #4 · 79.9K reputationPosted May 17, 2013, 10:31 PM EDT
insert into movie values ('i don''t luve u')
the record will be inserted as "i don't luve u"
Bhabani prasad Dash168 reputationPosted May 17, 2013, 10:39 PM EDT