I got the following database Exception

Posted on 2004-11-20
Last Modified: 2010-04-15
     "Syntax error (missing operator) in query expression '( ((? IS NULL AND 0Itemno IS NULL) OR (0Itemno = ?)) AND ((? IS NULL AND 1Band IS NULL) OR (1Band = ?)) AND ((? IS NULL AND 2Taklefa IS NULL) OR (2Taklefa = ?)) AND ((? IS NULL AND 3nashat IS NULL) OR (3nashat = ?)) AND ((? IS NULL AND 4value IS NULL) OR '."      

when using the following code when update or delete a record
the table youmia

0Item_no int
1Band      int
2Taklefa  int
3nashat  int
4value    double
5date    datetime

please what is the problem
Question by:hema3i
    LVL 96

    Expert Comment

    by:Bob Learned
    OR '."  at the end?

    LVL 1

    Expert Comment

    TheLearnedOne is correct the single quote is the cut-off to the expression.  It looks like the statement ends with and there the open parentheses at the beginning of the statement that does not look satisfied.

    Author Comment

    but where's the problem in my c# Code i only use

    i don't write the sql statment ,does the problem in the name of the fields like
    LVL 96

    Accepted Solution

    Was the SQL statement generated by the wizard?  If so, there are a few bugs with the code it generates.  You will have to manually fix the SQL yourself.  

    The DataAdapter uses the SQL for the DeleteCommand, InsertCommand, SelectCommand, and UpdateCommand to perform all the necessary operations for database operations.


    Featured Post

    Maximize Your Threat Intelligence Reporting

    Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

    Join & Write a Comment

    Extention Methods in C# 3.0 by Ivo Stoykov C# 3.0 offers extension methods. They allow extending existing classes without changing the class's source code or relying on inheritance. These are static methods invoked as instance method. This…
    Entity Framework is a powerful tool to help you interact with the DataBase but still doesn't help much when we have a Stored Procedure that returns more than one resultset. The solution takes some of out-of-the-box thinking; read on!
    It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
    Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

    745 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    16 Experts available now in Live!

    Get 1:1 Help Now