I got the following database Exception

     "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
dest.Update(ds,"youmia");
the table youmia

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

please what is the problem
hema3iAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Bob LearnedCommented:
OR '."  at the end?

Bob
0
sendmeblahCommented:
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.
0
hema3iAuthor Commented:
but where's the problem in my c# Code i only use

dest.Update(ds,"youmia");
 
i don't write the sql statment ,does the problem in the name of the fields like
"0Item_no","4value"
0
Bob LearnedCommented:
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.

Bob
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
C#

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.