السلام عليكم ...بعد ان قمت بتحزيم البرنامج بالفيجوال ستوديو 2010 وتثبيته على الجهاز وعند تشغيله تظهر رسالة خطأ عند الحفظ او التعديل برجاء المساعدة فى حل المشكلة لو تكرمتم
وعليكم السلام ورحمة الله وبركاته
الرجاء وضع الرسالة التى تظهر
لان من الواضح انك تستخدم قاعدة بيانات اكسس
وقد يكون الاسباب المسار او انك غير مثبت الاكسس عند العميل
فحسب الرسالة ستوضح المشكلة اين
تحياتى لك
وتمنياتى لك التوفيق
اشكرك اخى على الرد وبالفعل حاولت وضع صورة الرسالة التى تظهر لكن يبدو ان حجمهت كبير المهم ملخصها كما يلى
unhandled exception has occured in your application وفى نهاية الرسالة operation must use an updateable query
اضغط على زر التفاصيل
وانسخ ما بداخله كاملاً وقم بوضع المحتوى الرسالة هنا
او قم بارفاق المشروع لاتمام مراجعة الاكواد وتوضيح اين تقع المشكلة تماماً
تحياتى لك
وتمنياتى لك التوفيق
جزاك الله خيرا اخى الكريم ( الجوكر ) واسف على تعبك ومرفق نسخة من تفاصيل الرسالة
See the end of this message for details on invoking
just-in-time (JIT) debugging instead of this dialog box.
************** Exception Text **************
System.Data.OleDb.OleDbException (0x80004005): Operation must use an updateable query.
at System.Data.Common.DbDataAdapter.UpdatedRowStatusErrors(RowUpdatedEventArgs rowUpdatedEvent, BatchCommandInfo[] batchCommands, Int32 commandCount)
at System.Data.Common.DbDataAdapter.UpdatedRowStatus(RowUpdatedEventArgs rowUpdatedEvent, BatchCommandInfo[] batchCommands, Int32 commandCount)
at System.Data.Common.DbDataAdapter.Update(DataRow[] dataRows, DataTableMapping tableMapping)
at System.Data.Common.DbDataAdapter.UpdateFromDataTable(DataTable dataTable, DataTableMapping tableMapping)
at System.Data.Common.DbDataAdapter.Update(DataTable dataTable)
at Expenses.frmexpenses.butsave_Click(Object sender, EventArgs e)
at System.Windows.Forms.Control.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ButtonBase.WndProc(Message& m)
at System.Windows.Forms.Button.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
************** Loaded Assemblies **************
mscorlib
Assembly Version: 4.0.0.0
Win32 Version: 4.7.3133.0 built by: NET472REL1LAST
CodeBase: file:///C:/Windows/Microsoft.NET/Framework/v4.0.30319/mscorlib.dll
----------------------------------------
Expenses
Assembly Version: 1.0.0.0
Win32 Version: 1.0.0.0
CodeBase: file:///C:/Program%20Files/Default%20Company%20Name/Masrofaty/Expenses.exe
----------------------------------------
Microsoft.VisualBasic
Assembly Version: 10.0.0.0
Win32 Version: 14.6.1055.0 built by: NETFXREL2
CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/Microsoft.VisualBasic/v4.0_10.0.0.0__b03f5f7f11d50a3a/Microsoft.VisualBasic.dll
----------------------------------------
System
Assembly Version: 4.0.0.0
Win32 Version: 4.7.3151.0 built by: NET472REL1LAST_B
CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System/v4.0_4.0.0.0__b77a5c561934e089/System.dll
----------------------------------------
System.Core
Assembly Version: 4.0.0.0
Win32 Version: 4.7.3130.0 built by: NET472REL1LAST_B
CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Core/v4.0_4.0.0.0__b77a5c561934e089/System.Core.dll
----------------------------------------
System.Windows.Forms
Assembly Version: 4.0.0.0
Win32 Version: 4.7.3130.0 built by: NET472REL1LAST_B
CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Windows.Forms/v4.0_4.0.0.0__b77a5c561934e089/System.Windows.Forms.dll
----------------------------------------
System.Drawing
Assembly Version: 4.0.0.0
Win32 Version: 4.7.3130.0 built by: NET472REL1LAST_B
CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Drawing/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll
----------------------------------------
System.Configuration
Assembly Version: 4.0.0.0
Win32 Version: 4.6.1055.0 built by: NETFXREL2
CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Configuration/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll
----------------------------------------
System.Xml
Assembly Version: 4.0.0.0
Win32 Version: 4.7.3130.0 built by: NET472REL1LAST_B
CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Xml/v4.0_4.0.0.0__b77a5c561934e089/System.Xml.dll
----------------------------------------
System.Runtime.Remoting
Assembly Version: 4.0.0.0
Win32 Version: 4.7.3130.0 built by: NET472REL1LAST_B
CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Runtime.Remoting/v4.0_4.0.0.0__b77a5c561934e089/System.Runtime.Remoting.dll
----------------------------------------
IrisSkin4
Assembly Version: 2006.3.22.45
Win32 Version: 2006.3.22.45
CodeBase: file:///C:/Program%20Files/Default%20Company%20Name/Masrofaty/IrisSkin4.DLL
----------------------------------------
System.Data
Assembly Version: 4.0.0.0
Win32 Version: 4.7.3130.0 built by: NET472REL1LAST_B
CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_32/System.Data/v4.0_4.0.0.0__b77a5c561934e089/System.Data.dll
----------------------------------------
System.Transactions
Assembly Version: 4.0.0.0
Win32 Version: 4.7.3130.0 built by: NET472REL1LAST_B
CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_32/System.Transactions/v4.0_4.0.0.0__b77a5c561934e089/System.Transactions.dll
----------------------------------------
System.EnterpriseServices
Assembly Version: 4.0.0.0
Win32 Version: 4.6.1055.0 built by: NETFXREL2
CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_32/System.EnterpriseServices/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.EnterpriseServices.dll
----------------------------------------
System.Numerics
Assembly Version: 4.0.0.0
Win32 Version: 4.6.1055.0 built by: NETFXREL2
CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Numerics/v4.0_4.0.0.0__b77a5c561934e089/System.Numerics.dll
----------------------------------------
************** JIT Debugging **************
To enable just-in-time (JIT) debugging, the .config file for this
application or computer (machine.config) must have the
jitDebugging value set in the system.windows.forms section.
The application must also be compiled with debugging
enabled.
For example:
<configuration>
<system.windows.forms jitDebugging="true" />
</configuration>
When JIT debugging is enabled, any unhandled exception
will be sent to the JIT debugger registered on the computer
rather than be handled by this dialog box.
يبدو انك تستخدم اسلوب الاستعلام ومن ثم تعديث البيانات
ارفق هنا كود المستخدم لعمل التحديث لديك
لتوضح الامور اكثر لان نص الرسالة بالاعلى غير موضحة تماماً موقع المشكلة
واتمنى ان توضح لى هل قاعدة البيانات بامتداد mdb ام انه accdb
واذا كان من نوع mdb هل انت جعلت البرنامج يعمل فقط على نظام 32 Bit
وحيث ان جهاز العميل او المراد الاستخدام عليه من نوع 64Bit
وان جهازك الشخصي من نوع 32Bit والذى تم بناء البرنامج عليه
اتمنى توضيح ذلك
تحياتى لك
وتمنياتى لك التوفيق
هذا كود الحفظ
Private Sub butsave_Click_1(sender As System.Object, e As System.EventArgs) Handles butsave.Click
If combocreditor_name.Text.Trim = "" Then
MsgBox("برجاء إدخال إسم الدائن", MsgBoxStyle.Critical, "خطأ")
combocreditor_name.Focus()
Else
Dim sql = " select * from tblcredit where creditor_name = '" & combocreditor_name.Text & "'"
Dim adp As New OleDb.OleDbDataAdapter(sql, conn)
Dim ds = New DataSet
adp.Fill(ds)
Dim dt = ds.Tables(0)
If dt.Rows.Count > 0 Then
MsgBox(" إسم الدائن المدخل موجود تحت رقم" & dt.Rows(0).Item("credit_code"), MsgBoxStyle.Information, "تنبيه")
Else
Dim dr = dt.NewRow
dr!credit_code = txtcredit_code.Text
dr!creditor_name = combocreditor_name.Text
dr!credit_date = dtp.Text
dr!credit_amount = txtamount.Text
dr!credit_notes = txtnotes.Text
dt.Rows.Add(dr)
Dim cmd As New OleDb.OleDbCommandBuilder(adp)
adp.Update(dt)
butnew_Click_1(sender, e)
MsgBox("تم حفظ البيانات بنجاح", MsgBoxStyle.Information, "تأكيد")
ReloadRecords()
DisplayRecords()
End If
End If
End Sub
وانا استخدم قاعدة بيانات اكسس بامتداد accdb
تفضل اخى salah mansour
استخدم الكود بهذا الطريقة
والمشكلة هنا كانت بسبب الاستعلام كما وضحت مسبقاً
الكود الذى سيستخدم داخل الزر
كود :
If combocreditor_name.Text.Trim Is Nothing Then
MsgBox("برجاء إدخال إسم الدائن", MsgBoxStyle.Critical, "خطأ")
combocreditor_name.Focus()
Else
Dim sql = "select * from tblcredit where creditor_name = '" & combocreditor_name.Text & "'"
Dim adp As New OleDb.OleDbDataAdapter(sql, conn)
Dim dt As New DataTable
dt.Clear()
adp.Fill(dt)
If dt.Rows.Count > 0 Then
MsgBox(" إسم الدائن المدخل موجود تحت رقم" & dt.Rows(0).Item("credit_code"), MsgBoxStyle.Information, "تنبيه")
Else
Dim dr = dt.NewRow
dr!credit_code = txtcredit_code.Text
dr!creditor_name = combocreditor_name.Text
dr!credit_date = dtp.Text
dr!credit_amount = txtamount.Text
dr!credit_notes = txtnotes.Text
dt.Rows.Add(dr)
Dim cmd As New OleDb.OleDbCommandBuilder(adp)
adp.Update(dt)
butnew_Click_1(sender, e)
MsgBox("تم حفظ البيانات بنجاح", MsgBoxStyle.Information, "تأكيد")
ReloadRecords()
DisplayRecords()
End If
End If
تحياتى لك
وتمنياتى لك التوفيق
(19-08-18, 02:41 PM)elgokr كتب : [ -> ]تفضل اخى salah mansour
استخدم الكود بهذا الطريقة
والمشكلة هنا كانت بسبب الاستعلام كما وضحت مسبقاً
الكود الذى سيستخدم داخل الزر
كود :
If combocreditor_name.Text.Trim Is Nothing Then
MsgBox("برجاء إدخال إسم الدائن", MsgBoxStyle.Critical, "خطأ")
combocreditor_name.Focus()
Else
Dim sql = "select * from tblcredit where creditor_name = '" & combocreditor_name.Text & "'"
Dim adp As New OleDb.OleDbDataAdapter(sql, conn)
Dim dt As New DataTable
dt.Clear()
adp.Fill(dt)
If dt.Rows.Count > 0 Then
MsgBox(" إسم الدائن المدخل موجود تحت رقم" & dt.Rows(0).Item("credit_code"), MsgBoxStyle.Information, "تنبيه")
Else
Dim dr = dt.NewRow
dr!credit_code = txtcredit_code.Text
dr!creditor_name = combocreditor_name.Text
dr!credit_date = dtp.Text
dr!credit_amount = txtamount.Text
dr!credit_notes = txtnotes.Text
dt.Rows.Add(dr)
Dim cmd As New OleDb.OleDbCommandBuilder(adp)
adp.Update(dt)
butnew_Click_1(sender, e)
MsgBox("تم حفظ البيانات بنجاح", MsgBoxStyle.Information, "تأكيد")
ReloadRecords()
DisplayRecords()
End If
End If
تحياتى لك
وتمنياتى لك التوفيق
جزاك الله كل خير اخىالكريم .... جارى التعديل وباذن الله ساوافى حضرتك بالنتيجة
للأسف اخى الكريم رسالة الخطأ كما هى .... انا ضغطت مشروع البرنامج لكن لا استطيع رفعه بسبب رسالة كبر حجم الملف هل من سبيل اخر لارسال مشروع البرنامج لحضرتك
فقط استخدم اى مركز رفع الملفات مثل ميديا فاير سيكون افضل
واسهل فى التحميل ايضاً
وارسل لى الرابط وساقوم بالاطلاع عليه
تحياتى لك
وتمنياتى لك التوفيق