15-07-24, 08:51 AM
السلام عليكم ورحمة الله وبركاته :-
الاساتذة الاعزاء انا جديد في عالم البرمجة لذا اتبع شروحات لتكوين برنامج
في احد الاجرائات المستخدمة يكون الشرح على بأستخدام MySQL
انا اطبق الشرح على SqlServer
لم احصل على النتيجة كما في الشرح
الفكرة انه لدي كومبوبوكس اختار منه طريقة البحث بواسطة الباركود او الاسم او الشركة
وفي التيكست بوكس يكتب الباركود او الاسم او الشركة ليتم البحث عنه
الكود المستخدم هوة
cn.Open()
cm = New SqlCommand("SELECT * FROM tblProduct AS p INNER JOIN tblGeneric AS g ON p.ProductGeneric = GenericID INNER JOIN tblBrand AS b ON p.ProductBrand = BrandID INNER JOIN tblFromulation AS f ON p.ProductFromulation = FromulationID INNER JOIN tblClassification AS c ON p.ProductClassification = ClassificationID INNER JOIN tblType AS t ON p.ProductType = TypeID where ProductQuantity > 0 and " & cboFilter.Text & " like '" & txtSearch.Text & "'", cn)
dr = cm.ExecuteReader
الخطأ
[/url]System.data.sqlclient.sqlexception: 'incorrect syntax near the keyword 'like'.'
[url=https://www.codeproject.com/Questions/5385211/System-data-sqlclient-sqlexception-incorrect-synta]
الاساتذة الاعزاء انا جديد في عالم البرمجة لذا اتبع شروحات لتكوين برنامج
في احد الاجرائات المستخدمة يكون الشرح على بأستخدام MySQL
انا اطبق الشرح على SqlServer
لم احصل على النتيجة كما في الشرح
الفكرة انه لدي كومبوبوكس اختار منه طريقة البحث بواسطة الباركود او الاسم او الشركة
وفي التيكست بوكس يكتب الباركود او الاسم او الشركة ليتم البحث عنه
الكود المستخدم هوة
cn.Open()
cm = New SqlCommand("SELECT * FROM tblProduct AS p INNER JOIN tblGeneric AS g ON p.ProductGeneric = GenericID INNER JOIN tblBrand AS b ON p.ProductBrand = BrandID INNER JOIN tblFromulation AS f ON p.ProductFromulation = FromulationID INNER JOIN tblClassification AS c ON p.ProductClassification = ClassificationID INNER JOIN tblType AS t ON p.ProductType = TypeID where ProductQuantity > 0 and " & cboFilter.Text & " like '" & txtSearch.Text & "'", cn)
dr = cm.ExecuteReader
الخطأ
[/url]System.data.sqlclient.sqlexception: 'incorrect syntax near the keyword 'like'.'
[url=https://www.codeproject.com/Questions/5385211/System-data-sqlclient-sqlexception-incorrect-synta]
