title: Delete record from SQL database in VB.NET
body: <p>I want to delete a record which is related to the <code>SerialNo</code> in the database.</p>
  
  <p>This is my code: </p>
  
  <pre><code>Using con = New MySqlConnection("server=" &amp; server &amp; ";" &amp; "user id=" &amp; userid &amp; ";" &amp; "password=" &amp; password &amp; ";" &amp; "database=" &amp; database)
      con.Open()
      Dim sqlText = "DELETE * FROM datatable WHERE SerialNo = @ulogin"
      Using cmd = New MySqlCommand(sqlText, con)
          cmd.Parameters.AddWithValue("@ulogin", frmmain.txtinput.Text)
          cmd.ExecuteNonQuery()
      End Using
      con.Close()
  End Using
  </code></pre>
  
  <p>This code doesn't work. When I run the program, the following error appears:</p>
  
  <p><a href="https://i.stack.imgur.com/ujs6G.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ujs6G.png" alt="enter image description here"></a></p>
  
  <p>Please be kind enough to suggest a suitable solution.</p>
  
  <p><strong>NOTE:</strong> 221 means the entered number.</p>