Dim sqlcommand As String = "UPDATE studentdetails SET student_name=@txt_name , student_branch=@txt_branch ,student_class=@txt_class "
Dim com As New SqlCommand(sqlcommand, myConn)
com.Parameters.AddWithValue("@txt_name", txt_name.Text)
com.Parameters.AddWithValue("@txt_branch", txt_branch.Text)
com.Parameters.AddWithValue("@txt_class", txt_class.Text)
For Each Parameter As SqlParameter In com.Parameters
If Parameter.Value Is Nothing Then
Parameter.Value = DBNull.Value
End If
Next
com.ExecuteNonQuery()