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

Bhabani prasad DashPosted May 18, 2013, 2:39 AM
Praveen KumarPosted May 18, 2013, 2:31 AM
insert into movie values ('i don''t luve u')
the record will be inserted as "i don't luve u"
Bhabani prasad DashPosted May 18, 2013, 2:02 AM
Praveen KumarPosted May 18, 2013, 1:59 AM
You have to escape it by doubling it like this:
insert into movie values ('i don''t luve u')