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 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60
| Private Sub BtnValider_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BtnValider.Click
'etablissement dela connection
Dim objectconnection As SqlConnection = New SqlConnection
objectconnection.ConnectionString = "Persist Security Info=False;Integrated Security=SSPI;database=goeland;server=C008-PC-5216492"
'Objet SqlCommand
Dim cmd As New SqlCommand
'On indique que l'on souhaite utiliser une procédure stockée
cmd.CommandType = CommandType.StoredProcedure
'On donne le nom de cette procédure stockée
cmd.CommandText = "ps_newpers"
objectconnection.Open()
'Paramètres
cmd.Parameters.Add(New SqlParameter("@numemp", SqlDbType.Float, 8))
cmd.Parameters("@numemp").Value = Textnum.Text
cmd.Parameters.Add(New SqlParameter("@typerso", SqlDbType.NVarChar, 255))
cmd.Parameters("@typerso").Value = "p"
cmd.Parameters.Add(New SqlParameter("@nomempl", SqlDbType.NVarChar, 255))
cmd.Parameters("@nomempl").Value = "digdig"
cmd.Parameters.Add(New SqlParameter("@preempl", SqlDbType.NVarChar, 255))
cmd.Parameters("@preempl").Value = "biloute"
cmd.Parameters.Add(New SqlParameter("@adrempl", SqlDbType.NVarChar, 255))
cmd.Parameters("@adrempl").Value = "quelque part en france"
cmd.Parameters.Add(New SqlParameter("@etacivil", SqlDbType.NVarChar, 255))
cmd.Parameters("@etacivil").Value = "mr"
cmd.Parameters.Add(New SqlParameter("@sexe", SqlDbType.NVarChar, 255))
cmd.Parameters("@sexe").Value = "M"
cmd.Parameters.Add(New SqlParameter("@datnaiss", SqlDbType.SmallDateTime))
cmd.Parameters("@datnaiss").Value = "1983-13-05 00:00:00.000"
cmd.Parameters.Add(New SqlParameter("@datemb", SqlDbType.SmallDateTime))
cmd.Parameters("@datemb").Value = "2003-13-05 00:00:00.000"
cmd.Parameters.Add(New SqlParameter("@salemp", SqlDbType.Float, 8))
cmd.Parameters("@salemp").Value = "1500"
cmd.Parameters.Add(New SqlParameter("@tmptrav", SqlDbType.Float, 8))
cmd.Parameters("@tmptrav").Value = "35"
cmd.Parameters.Add(New SqlParameter("@typcont", SqlDbType.NVarChar, 255))
cmd.Parameters("@typcont").Value = "cdd"
cmd.Parameters.Add(New SqlParameter("@codact", SqlDbType.NVarChar, 255))
cmd.Parameters("@codact").Value = "a"
cmd.Parameters.Add(New SqlParameter("@datdec", SqlDbType.SmallDateTime))
cmd.Parameters("@datdec").Value = ""
cmd.Parameters.Add(New SqlParameter("@datfin", SqlDbType.SmallDateTime))
cmd.Parameters("@datfin").Value = ""
cmd.Parameters.Add(New SqlParameter("@hvolpil", SqlDbType.Float, 8))
cmd.Parameters("@salemp").Value = ""
Dim dataread As SqlDataReader
dataread = cmd.ExecuteReader()
Dim listbox1
Do While dataread.Read
listbox1.itemsadd(dataread.GetString(0))
Loop
dataread.Close()
objectconnection.Close()
Me.Dispose()
Dim frmpersnavi As New frmpersnav
frmpersnavi.ShowDialog()
End Sub
End Class |
Partager