title: how to update mysql database in vb.net
body: <pre><code>Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
  
      Dim remarks As String
      Dim am_OUT As String = &quot;11:30:01 AM&quot;
  
  
      If LblTime.Text &gt;= am_OUT Then
          remarks = &quot;OVERTIME&quot;
      Else
          remarks = &quot;PRESENT&quot;
      End If
  
      
      sql = &quot;UPDATE attendance SET  am_out=@am_out, noon_remarks=@noon_remarks &quot; &amp; _
            &quot;WHERE id_no= '&quot; &amp; Txtid.Text &amp; &quot;'AND date LIKE  '&quot; &amp; LblDate.Text &amp; &quot;'and am_out is null&quot;
  
      Try
          With com
              .Connection = con
              .CommandText = &quot;SELECT * FROM attendance WHERE id_no LIKE '&quot; &amp; Txtid.Text &amp; &quot;' AND date LIKE '&quot; &amp; LblDate.Text &amp; &quot;'AND am_out is NOT NULL&quot;
  
          End With
  
  
  
          com.Parameters.Add(New MySqlParameter(&quot;@am_out&quot;, LblTime.Text))
          com.Parameters.Add(New MySqlParameter(&quot;@noon_remarks&quot;, remarks))
  
          com.ExecuteNonQuery()
  
          If remarks = &quot;OVERTIME&quot; Then
              MessageBox.Show(&quot;You have little overtime&quot;)
          ElseIf remarks = &quot;PRESENT&quot; Then
              MessageBox.Show(&quot;You Log out on time&quot;)
          End If
  
  
  
  
      Catch ex As Exception
          MsgBox(ex.Message)
      End Try
  End Sub
  </code></pre>
  <p>I can't update my database table in mysql
  and mysql database already have amin and am remarks</p>