StringBuilder Error

Can somebody please help me with this?  I get red squiggly lines in the second sb.Append.
 
SqlConnection conn = new SqlConnection();
        conn.ConnectionString = ConfigurationManager.ConnectionStrings["upscale"].ConnectionString;

        conn.Open();

        System.Text.StringBuilder sb = new System.Text.StringBuilder(50);
        sb.Append("INSERT INTO tblConsigner(fname,lname,email,phone");
        sb.Append("VALUES("+ @FULL_NAME +"," + @EMAIL +"," + @PHONE +"," + @MESSAGES +")";

Open in new window


Thanks!
LVL 5
IsaacSharePoint Client Side DeveloperAsked:
Who is Participating?
 
käµfm³d 👽Connect With a Mentor Commented:
I believe this would fix the issue:

sb.Append("VALUES(@FULL_NAME, @EMAIL, @PHONE, @MESSAGES)");

Open in new window

0
 
Éric MoreauSenior .Net ConsultantCommented:
you are missing your closing )
0
 
rajapandian_81Commented:
It should be
sb.Append("VALUES("+ @FULL_NAME +"," + @EMAIL +"," + @PHONE +"," + @MESSAGES +")");

Open in new window

0
All Courses

From novice to tech pro — start learning today.