1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
| Imports System.Data
Imports System.Data.SqlClient
Public Class Form1
Private bs As New BindingSource()
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim cn As New SqlConnection("data source=.;initial catalog=tele_commerce;integrated security=sspi")
Dim da As New SqlDataAdapter("select * from client", cn)
Dim ds As New DataSet("client")
ds.Tables.Add("client")
da.Fill(ds.Tables("client"))
bs.DataSource = ds.Tables("client")
TextBox1.DataBindings.Add("text", bs, "numclient")
TextBox2.DataBindings.Add("text", bs, "nom")
bs.DataSource = ds.Tables("client")
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
bs.MoveNext()
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
bs.MovePrevious()
End Sub
End Class |