Imports System.Data.OleDb
Imports MySql.Data.MySqlClient
Public Class frmRegistration
Private Sub btnLogin_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnLogin.Click
Dim con = New MySqlConnection(conn)
Dim myCommand As New MySqlCommand
myCommand.Connection = con
myCommand.CommandText = "INSERT INTO tbl_students(name)" _
& "VALUES('" & txtServer.Text & "')"
Try
con.Open()
myCommand.ExecuteNonQuery()
con.Close()
Catch myerror As MySqlException
MsgBox("There was an error updating the database: " & myerror.Message)
End Try
End Sub
End Class
No comments:
Post a Comment