Bhabani prasad Dash

Bhabani prasad Dash

  • NA
  • 244
  • 44.6k

sql

May 18 2013 1:44 AM
am using nvarchar(200) in my table"movie" with col name "moviname".
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

Answers (4)