Can anyone help me!!!
Here is the code and explanation:
When i press button1 (which is Update) my DB should be Updated but that doesnt work.Why?Why?
dsn=acc is ODBC connection to ACCESS DB
Here is the code and explanation:
When i press button1 (which is Update) my DB should be Updated but that doesnt work.Why?Why?
dsn=acc is ODBC connection to ACCESS DB
Code:
Dim con As New ODBC.OdbcConnection("dsn=acc")
Dim command As New ODBC.OdbcCommand("SELECT * FROM SERVIS", con)
Dim adp As New ODBC.OdbcDataAdapter(command)
Dim ds As New DataSet("SERVIS")
Dim cmdBuilder As New ODBC.OdbcCommandBuilder(adp)
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
adp.Fill(ds, "SERVIS")
TextBox1.DataBindings.Add("Text", ds, "SERVIS.Rbr")
DataGrid1.DataMember = "SERVIS"
DataGrid1.DataSource = ds
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
adp.Update(ds, "SERVIS")
ds.AcceptChanges()
End Sub
Last edited by a moderator: