![]() |
ما الخطأ في هذا الكود
اخواني الأفاضل
عندي نموذج فواتير المبيعات و اريد ترحيل القيم الموجودة في الفاتورة الحالية الي جدول all_acc حيث ان النموذج قسمين الاول بة بيانات الفاتورة الاساسية و القسم الثاني عبارة عن datagrid بة تفاصيل الفاتورة و الكود يعمل جيدا في القسم الاول و لكن في القسم الثاني يقوم بتحيل اول سطر من datagrid فقط و لا اعرف لماذا كود: Dim sqltrhl AsString = "select * from all_acc" Dp3 = New SqlClient.SqlDataAdapter(sqltrhl, Con) Dim CmdB AsNew SqlCommandBuilder(Dp3) Dim ds7 AsNew DataSet Dp3.Fill(ds7, "all_acc") Dim tblrow As DataTable = ds7.Tables("all_acc") Dim trhlrow As DataRow = tblrow.NewRow trhlrow.Item("no1") = no1.Text trhlrow.Item("store_no") = Store_name.SelectedValue trhlrow.Item("type1") = type_name.SelectedValue trhlrow.Item("date1") = date1.Text ForEach CurRow As DataGridViewRow In dg.Rows trhlrow.Item("product_no") = dg.CurrentRow.Cells("product_no").Value trhlrow.Item("product_name") = dg.CurrentRow.Cells("product_name").Value trhlrow.Item("quantity") = dg.CurrentRow.Cells("quantity").Value trhlrow.Item("tot_price") = dg.CurrentRow.Cells("tot_price").Value Next tblrow.Rows.Add(trhlrow) Dp3.Update(ds7.Tables("all_acc")) |
الساعة الآن 03:16 AM |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd. TranZ By Almuhajir