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 29 30 31 32
|
Sub verifier_db()
Dim conn As New SqlConnection
Dim reader As SqlDataReader
Dim serverName As String = "basemaster"
conn.ConnectionString = "packet size=4096;user id=wpmreports;pwd=welcome;data source=""" & serverName & """;persist security info=False;initial catalog=DSDB"
conn.Open()
Dim cmd As SqlCommand
cmd = Nothing
cmd = New SqlCommand("SELECT dbo_PERSON.PERSON_ID, dbo_PERSON.FIRSTNAME, dbo_PERSON.LASTNAME, dbo_PERSON.INTERNET_ADD FROM dbo_PERSON WHERE (((dbo_PERSON.LASTNAME)='Sigaud'));", conn)
reader = cmd.ExecuteReader()
Dim tab(3) As String
While reader.Read
tab(0) = reader.GetString(0) 'person_id
tab(1) = reader.GetString(1) 'firstname
tab(2) = reader.GetString(2) 'lastname
tab(3) = reader.GetString(3) 'email
lbl1.Text = tab(3)
End While
reader.Close()
conn.Close()
End Sub |
Partager