Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / DataGrid / May 2006

Tip: Looking for answers? Try searching our database.

Update DetailsView with one template column

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Marc Eggenberger - 23 May 2006 15:52 GMT
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

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.