بسم الله الرحمن الرحيم
اخواني الاعزاء
وجهاتنى مشكلة فى زر الحذف , يقوم بالحذف فى الداتا سيت واقوم بعمل تحديث للدابتر , ثم لا يتم الحذف الفعلي فى قاعدة البيانات مع العلم انىة عمل على نظام الاتصال المتقطع
ارجوا منكم المساعدة فى هذا الموضوع ولكم جزيل الشكر والتقدير
Dim aa As New BindingSource
Me.BindingContext(ds.Tables("ProductType")).RemoveAt(Me.BindingContext(ds.Tables("ProductType")).Position)
Me.BindingContext(ds, "ProductType").EndCurrentEdit()
ds.AcceptChanges()
Me.Validate()
aa.EndEdit()
da.Update(ds, "ProductType")
ds.AcceptChanges()وهناك محاولة اخري قمت بها لكن بها مشكلة ثانية عندما يتم المسح لا يظهر فى الفورم مباشرة يتطلب اغرق الفورم ثم فتحة مرة اخري لمشاهدة نتيجة الحذف
Dim cmd As New System.Data.OleDb.OleDbCommand
cmd.CommandType = System.Data.CommandType.Text
cmd.CommandText = "DELETE FROM ProductType WHERE ProductTypeID = " & TextBox1.Text & " AND ProductTypeNmae = '" & TextBox2.Text & "'"
cmd.Connection = conn
conn.Open()
cmd.ExecuteNonQuery()
ds.AcceptChanges()
conn.Close()
Me.BindingContext(ds.Tables("ProductType")).Position -= 1