I tried everything that I can do - I'm a beginner at programming. I wanted to update my database in xampp using VB or Visual Studio but can't seem to do it.
This is my code for that form.:
Imports MySql.Data.MySqlClient
Public Class Form4
Public MysqlConn As MySqlConnection
Public cmd As New MySqlCommand
Public da As New MySqlDataAdapter
Public Sub MysqlConnection()
MysqlConn = New MySqlConnection()
'Connection String
MysqlConn.ConnectionString = "server=localhost;" _
& "user id=root;" _
& "password=;" _
& "database=bank"
'OPENING THE MysqlConnNECTION
MysqlConn.Open()
End Sub
Public Sub add()
Dim sql As String
Dim TempTable As New DataTable
sql = "update cbank set Balance = Balance + " & TextBox2.Text & "where AccountID = " & TextBox1.Text & "and PIN = " & TextBox3.Text & ";"
'bind the connection and query
With cmd
.Connection = MysqlConn
.CommandText = sql
End With
da.SelectCommand = cmd
End Sub
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
MysqlConnection()
add()
End Sub
End Class
There is no error it just that there is no output also