Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post Mar 07, 2012 11:41 AM by superguppie
Mar 05, 2012 05:06 PM|LINK
I have a customer DDL populated from a table. If I remove a cust from the table because that cust is no longer working here and a user edits a record that had that particular customer in it, an error occurs. How can I avoid this?
Mar 05, 2012 05:13 PM|LINK
Mar 05, 2012 05:19 PM|LINK
If your Udate Query is based on Customer, change it to based on ID or some other field.
Only a wild guess
Mar 05, 2012 05:24 PM|LINK
It needs to exist in the table and DDL or else the error appears. I guess I would have figure a way so that it doesn't appear to the user?
The error being:
'DropDownList1' has a SelectedValue which is invalid because it does not exist in the list of items.
Mar 05, 2012 05:27 PM|LINK
Mar 05, 2012 05:48 PM|LINK
Normally I do but there are exceptions where maybe it's not necessary given the type of quest, in this case it's a logic quest. The error is a standard well known one. but if it'll help:
DropDownList1.DataSource = dt;
<asp:DropDownList ID="DropDownList1" runat="server" DataTextField="cust">
Mar 05, 2012 05:53 PM|LINK
Mar 05, 2012 06:19 PM|LINK
That's the kicker, if I take the customer out of the table and the user edits a record that the customer is in, the error occurs, so I think it has to remain, maybe somehow hide it from the user?
Mar 05, 2012 06:27 PM|LINK
Mar 05, 2012 06:38 PM|LINK
The records must remain there is true as they need to be worked on. Can you explain about the "logical" delete?