28-09-20, 10:19 PM
السلام عليك اخواني المرمجين
لدي مشكل في البحث عن طريق رقم العميل
عند اضافة id تظهر رسالة الخطأ، وعند حذفها من الكود تعمل خاصية البحث
c#
access
PHP كود :
id,nomprenom+tel+telpapa+cin+id_eta
PHP كود :
private void tsearch_TextChanged(object sender, EventArgs e)
{
da = new OleDbDataAdapter("SELECT * FROM info where id,nomprenom+tel+telpapa+cin+id_eta like '%" + tsearch.Text + "%'", con);
con.Open();
dt = new DataTable();
da.Fill(dt);
dataGridView1.DataSource = dt;
con.Close();
}
كود الخطأ
كود :
System.Data.OleDb.OleDbException was unhandled
Message=Erreur de syntaxe (virgule) dans l'expression 'id,nomprenom+tel+telpapa+cin+id_eta like '%2%''.
Source=Microsoft JET Database Engine
ErrorCode=-2147217900
StackTrace:
à System.Data.OleDb.OleDbCommand.ExecuteCommandTextErrorHandling(OleDbHResult hr)
à System.Data.OleDb.OleDbCommand.ExecuteCommandTextForSingleResult(tagDBPARAMS dbParams, Object& executeResult)
à System.Data.OleDb.OleDbCommand.ExecuteCommandText(Object& executeResult)
à System.Data.OleDb.OleDbCommand.ExecuteCommand(CommandBehavior behavior, Object& executeResult)
à System.Data.OleDb.OleDbCommand.ExecuteReaderInternal(CommandBehavior behavior, String method)
à System.Data.OleDb.OleDbCommand.ExecuteReader(CommandBehavior behavior)
à System.Data.OleDb.OleDbCommand.System.Data.IDbCommand.ExecuteReader(CommandBehavior behavior)
à System.Data.Common.DbDataAdapter.FillInternal(DataSet dataset, DataTable[] datatables, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior)
à System.Data.Common.DbDataAdapter.Fill(DataTable[] dataTables, Int32 startRecord, Int32 maxRecords, IDbCommand command, CommandBehavior behavior)
à System.Data.Common.DbDataAdapter.Fill(DataTable dataTable)
à transport.finsc.tsearch_TextChanged(Object sender, EventArgs e) dans C:\Users\Rachid\Desktop\transport\transport\inscription.cs:ligne 277
à System.Windows.Forms.Control.OnTextChanged(EventArgs e)
à System.Windows.Forms.TextBoxBase.OnTextChanged(EventArgs e)
à System.Windows.Forms.TextBoxBase.WmReflectCommand(Message& m)
à System.Windows.Forms.TextBoxBase.WndProc(Message& m)
à System.Windows.Forms.TextBox.WndProc(Message& m)
à System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
à System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
à System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
à System.Windows.Forms.UnsafeNativeMethods.SendMessage(HandleRef hWnd, Int32 msg, IntPtr wParam, IntPtr lParam)
à System.Windows.Forms.Control.SendMessage(Int32 msg, IntPtr wparam, IntPtr lparam)
à System.Windows.Forms.Control.ReflectMessageInternal(IntPtr hWnd, Message& m)
à System.Windows.Forms.Control.WmCommand(Message& m)
à System.Windows.Forms.Control.WndProc(Message& m)
à System.Windows.Forms.ScrollableControl.WndProc(Message& m)
à System.Windows.Forms.ContainerControl.WndProc(Message& m)
à System.Windows.Forms.Form.WndProc(Message& m)
à System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
à System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
à System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
à System.Windows.Forms.UnsafeNativeMethods.CallWindowProc(IntPtr wndProc, IntPtr hWnd, Int32 msg, IntPtr wParam, IntPtr lParam)
à System.Windows.Forms.NativeWindow.DefWndProc(Message& m)
à System.Windows.Forms.Control.DefWndProc(Message& m)
à System.Windows.Forms.Control.WmKeyChar(Message& m)
à System.Windows.Forms.Control.WndProc(Message& m)
à System.Windows.Forms.TextBoxBase.WndProc(Message& m)
à System.Windows.Forms.TextBox.WndProc(Message& m)
à System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
à System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
à System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
à System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
à System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(Int32 dwComponentID, Int32 reason, Int32 pvLoopData)
à System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
à System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
à System.Windows.Forms.Application.RunDialog(Form form)
à System.Windows.Forms.Form.ShowDialog(IWin32Window owner)
à System.Windows.Forms.Form.ShowDialog()
à transport.index.pictureBox1_Click(Object sender, EventArgs e) dans C:\Users\Rachid\Desktop\transport\transport\index.cs:ligne 22
à System.Windows.Forms.Control.OnClick(EventArgs e)
à System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
à System.Windows.Forms.Control.WndProc(Message& m)
à System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
à System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
à System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
à System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
à System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(Int32 dwComponentID, Int32 reason, Int32 pvLoopData)
à System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
à System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
à System.Windows.Forms.Application.Run(Form mainForm)
à transport.Program.Main() dans C:\Users\Rachid\Desktop\transport\transport\Program.cs:ligne 18
à System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args)
à System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
à Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
à System.Threading.ThreadHelper.ThreadStart_Context(Object state)
à System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
à System.Threading.ThreadHelper.ThreadStart()
InnerException: