PC Review Forums Newsgroups Microsoft DotNet Microsoft ADO .NET manually create UpdateCommand; automatic onenot working for inform

Reply

manually create UpdateCommand; automatic onenot working for inform

 
Thread Tools Rate Thread
Old 07-04-2006, 05:54 AM   #1
=?Utf-8?B?R2VudGlhbiBIaWxh?=
Guest
 
Posts: n/a
Default manually create UpdateCommand; automatic onenot working for inform


I am trying to update an Informix database through a datagrid in
ASP.NET (Vb.NET) and I am using commandbuilder to that .NET provides.

I am able to get the records and populate the dataset, edit them but
when I click update I get the following error:

ERROR [HY000] [Informix][Informix ODBC Driver][Informix]IS [NOT] NULL
predicate may be used only with simple columns.

I use ODBC Informix driver 2.90.

Here is the Update command created by .NET:

UPDATE dms_tms_queue SET whse_code = ? , ship_id = ? , pps_num = ? ,
cust_num = ? , ship_num = ? , cust_po_num = ? , ship_name = ? ,
ship_address1 = ? , ship_address2 = ? , ship_address3 = ? , ship_city
= ? , ship_state = ? , ship_zip = ? , ship_cntry = ? , ship_phone = ?
, email_address = ? , payment_method = ? , ship_via_code = ? , memo_1
= ? , memo_2 = ? , memo_3 = ? , memo_4 = ? , memo_5 = ? , memo_6 = ? ,
memo_7 = ? , memo_8 = ? , memo_9 = ? , create_stamp = ? , create_user
= ? , ob_type = ? , ppd_coll = ? , transfer_num = ? , bo_num = ? WHERE
( (dms_tms_queue_id = ?) AND ((? IS NULL AND whse_code IS NULL) OR
(whse_code = ?)) AND ((? IS NULL AND ship_id IS NULL) OR (ship_id =
?)) AND ((? IS NULL AND pps_num IS NULL) OR (pps_num = ?)) AND ((? IS
NULL AND cust_num IS NULL) OR (cust_num = ?)) AND ((? IS NULL AND
ship_num IS NULL) OR (ship_num = ?)) AND ((? IS NULL AND cust_po_num
IS NULL) OR (cust_po_num = ?)) AND ((? IS NULL AND ship_name IS NULL)
OR (ship_name = ?)) AND ((? IS NULL AND ship_address1 IS NULL) OR
(ship_address1 = ?)) AND ((? IS NULL AND ship_address2 IS NULL) OR
(ship_address2 = ?)) AND ((? IS NULL AND ship_address3 IS NULL) OR
(ship_address3 = ?)) AND ((? IS NULL AND ship_city IS NULL) OR
(ship_city = ?)) AND ((? IS NULL AND ship_state IS NULL) OR
(ship_state = ?)) AND ((? IS NULL AND ship_zip IS NULL) OR (ship_zip =
?)) AND ((? IS NULL AND ship_cntry IS NULL) OR (ship_cntry = ?)) AND
((? IS NULL AND ship_phone IS NULL) OR (ship_phone = ?)) AND ((? IS
NULL AND email_address IS NULL) OR (email_address = ?)) AND ((? IS
NULL AND payment_method IS NULL) OR (payment_method = ?)) AND ((? IS
NULL AND ship_via_code IS NULL) OR (ship_via_code = ?)) AND ((? IS
NULL AND memo_1 IS NULL) OR (memo_1 = ?)) AND ((? IS NULL AND memo_2
IS NULL) OR (memo_2 = ?)) AND ((? IS NULL AND memo_3 IS NULL) OR
(memo_3 = ?)) AND ((? IS NULL AND memo_4 IS NULL) OR (memo_4 = ?)) AND
((? IS NULL AND memo_5 IS NULL) OR (memo_5 = ?)) AND ((? IS NULL AND
memo_6 IS NULL) OR (memo_6 = ?)) AND ((? IS NULL AND memo_7 IS NULL)
OR (memo_7 = ?)) AND ((? IS NULL AND memo_8 IS NULL) OR (memo_8 = ?))
AND ((? IS NULL AND memo_9 IS NULL) OR (memo_9 = ?)) AND ((? IS NULL
AND create_stamp IS NULL) OR (create_stamp = ?)) AND ((? IS NULL AND
create_user IS NULL) OR (create_user = ?)) AND ((? IS NULL AND ob_type
IS NULL) OR (ob_type = ?)) AND ((? IS NULL AND ppd_coll IS NULL) OR
(ppd_coll = ?)) AND ((? IS NULL AND transfer_num IS NULL) OR
(transfer_num = ?)) AND ((? IS NULL AND bo_num IS NULL) OR (bo_num =
?)) )


How can I create manually an Update Command that would be applied to the
dataset ?


Thank you very much

Gentian
  Reply With Quote
Old 08-04-2006, 08:37 AM   #2
OHM \( One Handed Man \)
Guest
 
Posts: n/a
Default Re: manually create UpdateCommand; automatic onenot working for inform

You could write it manually. The command builder tends to be over complex
because it tries to enforce all the rules; the syntax is

UPDATE YourTableName SET
ColumnName = Value,
//Next Column = Value,
//Next Column = Value

WHERE

This could be as simple as
WHERE ID = ?

HTH



--
( OHM ) - One Handed Man
AKA Terry Burns - http://TrainingOn.net


"Gentian Hila" <GentianHila@discussions.microsoft.com> wrote in message
news4B03341-9DD4-4DFB-984A-0839C3098B12@microsoft.com...
>I am trying to update an Informix database through a datagrid in
> ASP.NET (Vb.NET) and I am using commandbuilder to that .NET provides.
>
> I am able to get the records and populate the dataset, edit them but
> when I click update I get the following error:
>
> ERROR [HY000] [Informix][Informix ODBC Driver][Informix]IS [NOT] NULL
> predicate may be used only with simple columns.
>
> I use ODBC Informix driver 2.90.
>
> Here is the Update command created by .NET:
>
> UPDATE dms_tms_queue SET whse_code = ? , ship_id = ? , pps_num = ? ,
> cust_num = ? , ship_num = ? , cust_po_num = ? , ship_name = ? ,
> ship_address1 = ? , ship_address2 = ? , ship_address3 = ? , ship_city
> = ? , ship_state = ? , ship_zip = ? , ship_cntry = ? , ship_phone = ?
> , email_address = ? , payment_method = ? , ship_via_code = ? , memo_1
> = ? , memo_2 = ? , memo_3 = ? , memo_4 = ? , memo_5 = ? , memo_6 = ? ,
> memo_7 = ? , memo_8 = ? , memo_9 = ? , create_stamp = ? , create_user
> = ? , ob_type = ? , ppd_coll = ? , transfer_num = ? , bo_num = ? WHERE
> ( (dms_tms_queue_id = ?) AND ((? IS NULL AND whse_code IS NULL) OR
> (whse_code = ?)) AND ((? IS NULL AND ship_id IS NULL) OR (ship_id =
> ?)) AND ((? IS NULL AND pps_num IS NULL) OR (pps_num = ?)) AND ((? IS
> NULL AND cust_num IS NULL) OR (cust_num = ?)) AND ((? IS NULL AND
> ship_num IS NULL) OR (ship_num = ?)) AND ((? IS NULL AND cust_po_num
> IS NULL) OR (cust_po_num = ?)) AND ((? IS NULL AND ship_name IS NULL)
> OR (ship_name = ?)) AND ((? IS NULL AND ship_address1 IS NULL) OR
> (ship_address1 = ?)) AND ((? IS NULL AND ship_address2 IS NULL) OR
> (ship_address2 = ?)) AND ((? IS NULL AND ship_address3 IS NULL) OR
> (ship_address3 = ?)) AND ((? IS NULL AND ship_city IS NULL) OR
> (ship_city = ?)) AND ((? IS NULL AND ship_state IS NULL) OR
> (ship_state = ?)) AND ((? IS NULL AND ship_zip IS NULL) OR (ship_zip =
> ?)) AND ((? IS NULL AND ship_cntry IS NULL) OR (ship_cntry = ?)) AND
> ((? IS NULL AND ship_phone IS NULL) OR (ship_phone = ?)) AND ((? IS
> NULL AND email_address IS NULL) OR (email_address = ?)) AND ((? IS
> NULL AND payment_method IS NULL) OR (payment_method = ?)) AND ((? IS
> NULL AND ship_via_code IS NULL) OR (ship_via_code = ?)) AND ((? IS
> NULL AND memo_1 IS NULL) OR (memo_1 = ?)) AND ((? IS NULL AND memo_2
> IS NULL) OR (memo_2 = ?)) AND ((? IS NULL AND memo_3 IS NULL) OR
> (memo_3 = ?)) AND ((? IS NULL AND memo_4 IS NULL) OR (memo_4 = ?)) AND
> ((? IS NULL AND memo_5 IS NULL) OR (memo_5 = ?)) AND ((? IS NULL AND
> memo_6 IS NULL) OR (memo_6 = ?)) AND ((? IS NULL AND memo_7 IS NULL)
> OR (memo_7 = ?)) AND ((? IS NULL AND memo_8 IS NULL) OR (memo_8 = ?))
> AND ((? IS NULL AND memo_9 IS NULL) OR (memo_9 = ?)) AND ((? IS NULL
> AND create_stamp IS NULL) OR (create_stamp = ?)) AND ((? IS NULL AND
> create_user IS NULL) OR (create_user = ?)) AND ((? IS NULL AND ob_type
> IS NULL) OR (ob_type = ?)) AND ((? IS NULL AND ppd_coll IS NULL) OR
> (ppd_coll = ?)) AND ((? IS NULL AND transfer_num IS NULL) OR
> (transfer_num = ?)) AND ((? IS NULL AND bo_num IS NULL) OR (bo_num =
> ?)) )
>
>
> How can I create manually an Update Command that would be applied to the
> dataset ?
>
>
> Thank you very much
>
> Gentian



  Reply With Quote
Reply



Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off