Dim MyConnexion As SqlConnection = New SqlConnection("Data Source=.\sqlexpress;" & _ "Integrated Security=SSPI;Initial Catalog=autoecole") Dim Mycommand As SqlCommand = New SqlCommand("SELECT * FROM charge",MyConnexion ) Dim DtA As New SqlDataAdapter(Mycommand) Dim DtS As New DataSet() Try MyConnexion.Open() DtA.Fill(DtS, "charge") 'charge qui est évidemment le nom de la table que tu veux afficher... DataGridView1.DataSource = DtS.Tables("charge") DataGridView1.DataMember = "charge" MyConnexion.Close() Catch ex as Exception End Try
SELECT id,prix FROM charge
Vous n’avez pas trouvé la réponse que vous recherchez ?
Posez votre question