以下のコードはエラーなしで動作しますが、更新値はデータベースに保存されません??? データベース値を更新する正しい方法???
Try
da = New SqlDataAdapter("SELECT * FROM studentdetails where student_id= @id", myConn)
da.SelectCommand.Parameters.AddWithValue("@id", txt_id.Text)
da.Fill(dset, "studentdetails")
If dset.Tables("studentdetails").Rows(0)("student_id") = Convert.ToInt32(txt_id.Text) Then
dset.Tables("studentdetails").Rows(0)("student_name") = txt_name.Text
dset.Tables("studentdetails").Rows(0)("student_branch") = txt_branch.Text
dset.Tables("studentdetails").Rows(0)("student_class") = txt_class.Text
MsgBox("Update Complete")
Else
MsgBox("Record not found")
End If
Catch ex As Exception
MsgBox(ex.Message)
Finally
myConn.Close()
End Try