Results 1 to 2 of 2

Thread: update database

  1. #1

    Thread Starter
    Lively Member flog3941's Avatar
    Join Date
    Nov 2002
    Posts
    123

    update database

    I have this code written to update my dataset under a button click event:


    daEmployee.update(dsEmployeeInfo1)


    The problem is when I click the button an error message comes up saying "expression too complex". What causes this?
    My database has 100 columns is this the reason? If so how do I correct this?

  2. #2
    Registered User
    Join Date
    Nov 2002
    Location
    Växjö, Sweden
    Posts
    314
    I am not sure of this but a guess could be that you are using a .NET built update command (maybe from a typed dataset) and the technique that .NET uses is that it builds the command to hold all column info for the update. To give you an example, it does this:

    UPDATE Publishers
    SET pub_id = ?, pub_name = ?, city = ?
    WHERE ( (pub_id = ?)
    AND ((? IS NULL AND pub_name IS NULL) OR (pub_name = ?))
    AND ((? IS NULL AND city IS NULL) OR (city = ?))

    Rather than this:

    UPDATE Publishers
    SET pub_id = ?, pub_name = ?, city = ?
    WHERE pub_id = ?

    So if you have 100 coulmns the last example would only extend the SET part a bit, but the first that .NET build will add an AND part for each column. This might render the query to complex. Try to retype your update command if this is the case.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width