09-09-2012, 10:55 AM
Ah okay, I simply overlooked that! Sorry!
Hmm.
Well, with your current code, you are creating an adapter and you are sending in your Command Text and Connection variables via the parameters. However, I believe that this error is occurring because you do not actually have a MySqlCommand variable. Try revising your code so it contains a MySqlCommand variable (And be sure to link it to the connection), as such:
[code2=vbnet]Dim commandText As String = "Update personalinfo, schoolinfo set sno = '" & txtSno.Text & "', lastname = '" & txtLastName.Text & "', middlename = '" & txtMiddleName.Text & "', gender = '" & cmbGender.Text & "', dateofbirth = '" & txtBirthday.Text & "', school = '" & txtCollege.Text & "', course = '" & cmbCourse.Text & "', department = '" & txtDepartment.Text & "', dateenrolled = '" & txtEnrolled.Text & "', yeargraduated = '" & txtGraduated.Text & "', where no = '" & txtSno.Text & "'"
Dim MySQLConn As MySqlConnection = New MySqlConnection
Dim MySQLComm As MySqlCommand = New MySqlCommand(commandText, MySQLConn)
Dim da As MySqlDataAdapter
Dim ds As DataSet = New DataSet("newDataSet")
da = New MySqlDataAdapter(MySQLComm)[/code2]
This should resolve your problem. I have never actually tried connecting to a MySQL Server using the method that you are using, so I apologize if I am incorrect on the matter.
Hmm.
Well, with your current code, you are creating an adapter and you are sending in your Command Text and Connection variables via the parameters. However, I believe that this error is occurring because you do not actually have a MySqlCommand variable. Try revising your code so it contains a MySqlCommand variable (And be sure to link it to the connection), as such:
[code2=vbnet]Dim commandText As String = "Update personalinfo, schoolinfo set sno = '" & txtSno.Text & "', lastname = '" & txtLastName.Text & "', middlename = '" & txtMiddleName.Text & "', gender = '" & cmbGender.Text & "', dateofbirth = '" & txtBirthday.Text & "', school = '" & txtCollege.Text & "', course = '" & cmbCourse.Text & "', department = '" & txtDepartment.Text & "', dateenrolled = '" & txtEnrolled.Text & "', yeargraduated = '" & txtGraduated.Text & "', where no = '" & txtSno.Text & "'"
Dim MySQLConn As MySqlConnection = New MySqlConnection
Dim MySQLComm As MySqlCommand = New MySqlCommand(commandText, MySQLConn)
Dim da As MySqlDataAdapter
Dim ds As DataSet = New DataSet("newDataSet")
da = New MySqlDataAdapter(MySQLComm)[/code2]
This should resolve your problem. I have never actually tried connecting to a MySQL Server using the method that you are using, so I apologize if I am incorrect on the matter.