السلام عليكم ورحمة الله وبركاته
السادة أعضاء منتدانا الكريم
استخدم برنامج Visual Basic 2010
وقاعدة بيانات اكسيس 2010
اقوم بتصميم برنامج لإدارة سوبر ماركت عند ادخال بيانات الاصناف في فاتوره الشراء يتم تسجيلها في DataGridview لكن عند تعديلها لا تحفظ في قاعدة البيانات
والمدخلات الأولى فقط هي التي تحفظ واستخدمت جملة Loop الأتية :
For i As Integer = 0 To DataGridView1.Rows.Count - 1
Operationscmd = New OleDbCommand(" Update Operations SET buyDiscound=" & DataGridView1(9, DataGridView1.Rows(i).Index).Value & ", BuyEarn =" & DataGridView1(11, DataGridView1.Rows(i).Index).Value & ", BuyNotes ='" & DataGridView1(12, DataGridView1.Rows(i).Index).Value & "', BuyQty = " & DataGridView1(7, DataGridView1.Rows(i).Index).Value & ",BuyUnitePirce = " & DataGridView1(3, DataGridView1.Rows(i).Index).Value & ",OperItemExp = #" & DataGridView1(5, DataGridView1.Rows(i).Index).Value & "#,TotalB =" & DataGridView1(10, DataGridView1.Rows(i).Index).Value & ",TotalG = " & DataGridView1(8, DataGridView1.Rows(i).Index).Value & ") Where Operations.OperID= " & DataGridView1(0, DataGridView1.Rows(i).Index).Value & "", con)
con.Open()
Operationscmd.ExecuteNonQuery()
con.Close()
لكن للاسف بدون فائدة لا تحفظ البيانات المعدلة بقاعدة البيانات
مرفق إليكم قاعدة البيانات والفورم