UPDATE QUERY RETURNING

UPDATE QUERY RETURNING

Postby landsharkdaddy » Mon 20 Apr 2009 21:51

I have the following query:

UPDATE lanemanagement.customers
SET customertitle = :customertitle, customerfirstname= :customerfirstname, customermiddleinitial = :customermiddleinitial,customerlastname = :customerlastname, customersuffix = :customersuffix, customeremail = :customeremail, customerstreet1 = :customerstreet1, customerstreet2 = :customerstreet2, customercity = :customercity, customerstateabbr = :customerstateabbr, customerzip = :customerzip, customerphone = :customerphone, customercellphone = :customercellphone, customerworkphone = :customerworkphone, customerworkphoneext = :customerworkphoneext, customerfax = :customerfax, customerreferredby = :customerreferredby, customerdatelastmodified = :customerdatelastmodified
WHERE (customerid = :customerid)

I have a strongly typed dataset and when this query is executed using the command object of that dataset I get an error that says: Parameter 'customerid is missing

It is called using this int returnValue = command.ExecuteNonQuery()

I think I probably need to do some kind of return or something but not sure. I really need to get this working so any help that you can give me would be appreciated.
landsharkdaddy
 
Posts: 3
Joined: Fri 17 Apr 2009 15:14

Postby Shalex » Tue 21 Apr 2009 10:27

Why do you create your own update command? It is created automatically when generating the typed Devart DataSet via (Tools | PostgreSQL | DataSet Wizard). So you can call it this way: dataSet_instance.table_name.Update(); .

Probably, in your case you don't add the customerid parameter to the parameters collection of the PgSqlCommand object.
1. How did you create your dataset?
2. Did you create the update command automatically or yourself? If you create the command yourself, you need to take care about the parameters collection, its initialization etc.
3. Where and why do you call this update command?
4. Could you please send us (support at devart*com, topic "Using Devart DataSet") a small test project that reproduces the problem? Please include definitions of database objects and avoid using third-party components.
Shalex
Devart Team
 
Posts: 7654
Joined: Thu 14 Aug 2008 12:44

Postby landsharkdaddy » Tue 21 Apr 2009 12:43

I call this update simply because that is what I thought I needed to do. No real reason I guess at all. But, the real question here is not why do I do it but why is this not working? I pass in all the parameters to the query and it returns an error. I just want to know if anyone can help me understand why this is not working properly. Thank you for your help so far. I will also take a look at doing it the way you are suggesting but again, I still want to know what is wrong with this one so I can make sure to never do that again.
landsharkdaddy
 
Posts: 3
Joined: Fri 17 Apr 2009 15:14

Postby Shalex » Tue 21 Apr 2009 13:21

Please send us (support at devart*com, topic "Using Devart DataSet") a small test project that reproduces the problem. Please include definitions of database objects and avoid using third-party components.

We need a whole project to identify the reason of this error.
Shalex
Devart Team
 
Posts: 7654
Joined: Thu 14 Aug 2008 12:44


Return to dotConnect for PostgreSQL