21-08-20, 02:05 AM
(آخر تعديل لهذه المشاركة : 21-08-20, 02:10 AM {2} بواسطة خالد كامل1.)
(20-08-20, 01:27 PM)asemshahen5 كتب : ضف الصف الى الداتا تابل فتنجح الاضافة .
كما ترى ضفته نقل لى كل الجدول وليس الصف
كود :
Dim d As Integer
Dim da_ As New OleDbDataAdapter
da_ = New OleDbDataAdapter("select * from product where pro_id=" & DataGridView1.CurrentRow.Cells(0).Value & "", con)
'da_.Parameters.Add(New OleDb.OleDbParameter("@pro_id", OleDb.OleDbType.Integer)).Value = d
Dim da_set As New DataSet
da_set = New DataSet
da_.Fill(da_set)
Dim dt_ = da_set.Tables(0)
Dim dr_ = dt_.NewRow
dr_!pro_id = d
dr_!pro_code = DataGridView1.CurrentRow.Cells(1).Value
dr_!pro_name = DataGridView1.CurrentRow.Cells(2).Value
dr_!d1 = d1.Value
dr_!pro_buy = DataGridView1.CurrentRow.Cells(4).Value
dr_!pro_sales = DataGridView1.CurrentRow.Cells(5).Value
dr_!unit = DataGridView1.CurrentRow.Cells(6).Value
dr_!pro_qty = qty
dr_!makh_code = makh_code2.Text
dr_!makh_name = makh_name2.Text
dt_.Rows.Add(dr_)
Dim save__ As New OleDb.OleDbCommandBuilder(da_)
da_.Update(dt_)
End If
Next
