Hi Expert,
I am new coders, I have a problem importing or updating mysql table, I dont know how to start this, Is this possible?, I have only little code but it is very bugy, what is the best language vb.net or c#, please help me
here is my buggy code:
I am new coders, I have a problem importing or updating mysql table, I dont know how to start this, Is this possible?, I have only little code but it is very bugy, what is the best language vb.net or c#, please help me
here is my buggy code:
Code:
Private Sub cmdsave_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdsave.Click
Dim conn As New MySqlConnection
conn.ConnectionString = "Server=server; User Id=root; Password=; Database=stock_data"
'Dim myConnection As New MySqlConnection(conn)
Dim cmd As String = "SELECT 8 FROM stock_data "
DA = New MySqlDataAdapter(cmd, conn)
' This line of code to generate update commands automatically.
' This update method of would not work without this line of code.
Dim MySQLCommandBuilder As New MySqlCommandBuilder(DA)
conn.Open()
DS = New DataSet()
DA.Fill(DS, "stock_data")
BS = New BindingSource
BS.DataSource = DS.Tables(0)
Dim BN As BindingNavigator = New BindingNavigator()
BN.BindingSource = BS
DataGridView1.DataSource = DS
End Sub