16-02-19, 01:12 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.Currency)).Value = txtPris.Text
cmd.Parameters.Add(New OleDbParameter("@Pro_Moms", OleDbType.Currency)).Value = txtmoms.Text
cmd.Parameters.Add(New OleDbParameter("@Pro_Totalt", OleDbType.Currency)).Value = 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لا إله إلا الله وحده لا شريك له له الملك وله الحمد وهو على كل شئ قدير
سبحان الله وبحمده سبحان الله العظيم
سبحان الله والحمد لله ولا إله إلا الله والله أكبر ولا حول ولا قوة إلا بالله العلى العظيم
رب أغفر لي

