1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
|
Dim SqlConnNew As New SqlConnection(StrConn)
SqlConnNew.Open()
Dim SqlCmdSelect As New SqlCommand("SELECT * FROM Produit", SqlConnNew)
Dim SqlCmdInsert As New SqlCommand("INSERT INTO Produit VALUES(@ProIDProduit,@ProRefProduitProduit,@ProRefFournisseurProduit,@ProTypeProduit,@ProFabricantProduit,@ProNomProduit,@ProPAHTVAProduit,@ProPVHTVAProduit,@ProQuantiteProduit)", SqlConnNew)
SqlCmdInsert.Parameters.Add("@ProIDProduit", SqlDbType.Int, 10, "RefProduit")
SqlCmdInsert.Parameters.Add("@ProRefFournisseurProduit", SqlDbType.Int, 10, "RefFournisseur")
SqlCmdInsert.Parameters.Add("@ProTypeProduit", SqlDbType.Char, 30, "ProType")
SqlCmdInsert.Parameters.Add("@ProFabricantProduit", SqlDbType.Char, 30, "ProFabricant")
SqlCmdInsert.Parameters.Add("@ProNomProduit", SqlDbType.Char, 30, "ProNom")
SqlCmdInsert.Parameters.Add("@ProPAHTVAProduit", SqlDbType.Int, 6, "ProPAHTVA")
SqlCmdInsert.Parameters.Add("@ProPVHTVAProduit", SqlDbType.Int, 6, "ProPVHTVA")
SqlCmdInsert.Parameters.Add("@ProQuantiteProduit", SqlDbType.Int, 5, "ProQuantite")
Dim ProduitCommandBuilder As New SqlCommandBuilder(SqlDA)
SqlDA.SelectCommand = SqlCmdSelect
SqlDA.InsertCommand = SqlCmdInsert
SqlDA.Fill(DSProduit, "Produit")
DTProduit = DSProduit.Tables("Produit") |
Partager