4
Answers

sql

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)
0
Suresh M

Suresh M

NA 18.6k 1.5m 9y
write this code in new class file and you can call it any form
0
Priya M

Priya M

NA 38 4.1k 9y
I also write this code..
 
but how i will call this code on different form .
0
Suresh M

Suresh M

NA 18.6k 1.5m 9y
Regex pattern = new Regex(@"(?<!\d)\d{10}(?!\d)");

    if(pattern.isMatch(socialSecNumber))
    {
        //Do something
        return true;
    }
    else
    {
        return false;
    }