Hi there.
I try to do the following:
I have a SqlDataSource with a Select Command where I have a custom sql
query which selects me data from 4 tables (1 main, the other tree have
Names for IDs which are in the main table).
I display everything in a datagridview and have a Select column which then
updates a DetailsView below. This works great.
I added the Edit possibility to the DetailsView. This is where I'm stuck
now. I changed one status column to be a template column. In the
EditTemplate I removed the textbox and added a DropDownList. The
SqlDataSource of this DropDownList is another which pulls all the StatusID
and StatusName from the table Status. I then add a DataBinding to the
SelectedValue which is the StatusID from the DetailsView. This also works
great. Now my problem is how do I do my update statement? I only need to
update the Alert table and set the status. All other fields are read only.
The update sql command would be something like:
Update Alert SET Status = @StatusID WHERE AlertID = @AlertID
I can then set the parameter AlertID to Control as Parameter Source and
ControlID my DetailsView (I have set the AlertID as the ID of this view).
But how do I specify my statusid? Its in the dropdownlist. How should I do
this?
Any hints?
Regards,
Marc
Brock Allen - 23 May 2006 16:02 GMT
The parameters to the update have to be the same names as the returned column
names form the select.
-Brock
http://staff.develop.com/ballen
> Hi there.
>
[quoted text clipped - 34 lines]
>
> Marc