16-02-19, 12:19 AM
جرب الكود التالي
كود :
Try
cmd = New OleDbCommand("Insert Into TBL_Products ( Pro_Code, Pro_Name, Pro_Price, Pro_Moms, Pro_Totalt) values
(@Pro_Code, @Pro_Name, @Pro_Price, @Pro_Moms, @Pro_Totalt)", con)
cmd.Parameters.Add(New OleDbParameter("@Pro_Code", OleDbType.Integer)).Value = txtcode.Text
cmd.Parameters.Add(New OleDbParameter("@Pro_Name", OleDbType.VarChar)).Value = txtDes.Text
cmd.Parameters.Add(New OleDbParameter("@Pro_Price", OleDbType.Double)).Value = CDbl(txtpris.Text)
cmd.Parameters.Add(New OleDbParameter("@Pro_Moms", OleDbType.Double)).Value = CDbl(txtmoms.Text)
cmd.Parameters.Add(New OleDbParameter("@Pro_Totalt", OleDbType.Double)).Value = CDbl(txttotalt.Text)
con.Open()
cmd.ExecuteNonQuery()
MsgBox("Done!")
txtcode.Text = " "
txtDes.Text = " "
txtPris.Text = " "
txtmoms.Text = " "
txttotalt.Text = " "
Catch ex As Exception
MsgBox(ex.Message)
Finally
con.Close()
End Tryلا إله إلا الله وحده لا شريك له له الملك وله الحمد وهو على كل شئ قدير
سبحان الله وبحمده سبحان الله العظيم
سبحان الله والحمد لله ولا إله إلا الله والله أكبر ولا حول ولا قوة إلا بالله العلى العظيم
رب أغفر لي

