my form 1:
how can i make the datagridview(its in form1) automatically show my new data
Thanks in advance
Public Class Form1 Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim cnn As New Odbc.OdbcConnection Dim cmd As New Odbc.OdbcCommand() Dim dr As Odbc.OdbcDataReader Try cnn.ConnectionString = "Dsn=class" cnn.Open() cmd = cnn.CreateCommand cmd.CommandText = "insert into customer(custno,custname,address,contactno,email) values(null,'" & TextBox1.Text & "','" & TextBox2.Text & "','" & TextBox3.Text & "','" & TextBox4.Text & "')" dr = cmd.ExecuteReader TextBox1.Text = " " TextBox2.Text = " " TextBox3.Text = " " TextBox4.Text = " " MsgBox("Success") Catch ex As Exception MsgBox("Error: " & ex.Source & " : " & ex.Message) End Try End Sub
how can i make the datagridview(its in form1) automatically show my new data
Thanks in advance