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 33 34 35 36
| 'Declare la connection
Dim Connect As New System.Data.SqlClient.SqlConnection("Persist Security Info=False;Integrated Security=False;uid =ccnetdev; password =pw;Initial Catalog=UniversalActionLog;server=mabase")
'Ouvre la Connection
Dim myrow As DataRow
Connect.Open()
'Requete sql, appel procedure
Dim myCommand As New SqlCommand("dbo.PS_LOG_Viewer", Connect)
Dim myReader As SqlDataReader
Dim myparam As SqlParameter
myparam = New SqlParameter("@AREA", ComboBox_Area.SelectedItem)
myCommand.Parameters.Add(myparam)
Dim myparam1 As SqlParameter
myparam1 = New SqlParameter("@ACTION", ComboBox_Action.SelectedItem)
myCommand.Parameters.Add(myparam1)
Dim myparam2 As SqlParameter
myparam2 = New SqlParameter("@SUBACTION", ComboBox_SubAction.SelectedItem)
myCommand.Parameters.Add(myparam2)
myReader = myCommand.ExecuteReader() '<= Voila ou se met l'erreur
Do While myReader.Read()
myrow = glog.NewRow
glog.Rows.Add(myrow)
Loop
myReader.Close()
Connect.Close()
End sub |