@JM
Hi i tried your codes to retrieve and update data in my textbox which is bound to a field in database. When i launch the application the textbox does not display the data?? can you tell me what could be possibly wrong??
vb Code:
Private connection As New SqlClient.SqlConnection("Data Source=.\SQLEXPRESS;AttachDbFilename=D:\ProjectMW\MachineWale\MachineWale\DatabaseMW.mdf;Integrated Security=True;User Instance=True")
Private adapter As New SqlClient.SqlDataAdapter("SELECT kmsrun FROM machineprofile", connection)
Private table As New DataTable
Private Sub InitialiseDataAdapter()
Dim update As New SqlClient.SqlCommand("UPDATE machineprofile SET kmsrun = '" & TextBox10.Text & "' WHERE MachineID = '" & TextBox1.Text & "'", Me.connection)
Me.adapter.UpdateCommand = update
Me.adapter.MissingSchemaAction = MissingSchemaAction.AddWithKey
Private Sub GetData()
Me.adapter.Fill(Me.table)
End Sub
Private Sub SaveData()
Me.adapter.Update(Me.table)
End Sub