1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
|
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
Dim con As SqlConnection = Nothing
Dim command As SqlCommand = Nothing
Dim cs As String = "Data Source=SQL\serveur;Initial Catalog=CATALOGUE;User Id=USER;Password=PASS"
Dim dr As SqlDataReader = Nothing
Dim combo As String = ""
combo = ComboBox1.Items.ToString
con = New SqlConnection(cs)
con.Open()
command = New SqlCommand("SELECT NomTransporteur FROM SuiviReception WHERE ID='" & combo & "';", con)
dr = command.ExecuteReader()
While dr.Read
Me.LBL_COUT.Text = "Nom Transporteur " & dr.GetValue(0) & "?"
End While
End Sub |