title: System.Data.SqlClient.SqlException: 'Incorrect syntax near 'student'.'
body: <p>I tried rewrite other ways but the code always showing error like this</p>
  <blockquote>
  <p>System.Data.SqlClient.SqlException: 'Incorrect syntax near 'student'</p>
  </blockquote>
  <p>The error occurs on the line</p>
  <pre><code>cmd.ExecuteNonQuery();
  </code></pre>
  <p>I hope someone will be able to help.</p>
  <pre><code>private void button1_Click(object sender, EventArgs e)
  {
      if (StudUsn.Text == &quot;&quot; || StudName.Text == &quot;&quot; || 
          FatherName.Text == &quot;&quot; || MotherName.Text == &quot;&quot; ||
          AddressTb.Text == &quot;&quot; || CollegeTb.Text == &quot;&quot;)
      {
          MessageBox.Show(&quot;No empty filled accepted&quot;);
      }
      else
      {
          Con.Open();
  
          String query = &quot;insert into Student_tbl values(&quot; + StudUsn.Text + &quot;,'&quot; + FatherName.Text + &quot;','&quot; + MotherName.Text + &quot;','&quot; + AddressTb.Text + &quot;','&quot; + CollegeTb.Text + &quot;','&quot; + StudRoomCb + &quot;','&quot; + StudStatusCb + &quot;')&quot;;
  
          SqlCommand cmd = new SqlCommand(query, Con);
          cmd.ExecuteNonQuery();
  
          MessageBox.Show(&quot;Student successfully added&quot;);
  
          Con.Close();
  
          updateBookedStatus();
          FillStudentDGV();
          FillStudentCombobox();
      }
  }
  </code></pre>