pass a record id to an insert query

J

Jim

Using .Net 3.5 vb and sql 2005 server.

I hava a page that has a GridView on it that lists items from a table -
ItemList.aspx. I want to make a hyperlink for each record that when clicked
will pass the ItemID to another page - MyItems.aspx.

The MyItems.aspx page is an "insert" formview page that I want to populate
some of the fields with the information from the record being passed. And
have other fields that the user will fillout and finally click "insert" to
put the new record into a different table.

1. Do I use a FormView for the MyItems.aspx page and set the mode to
"insert"?

2. I know how to make a master/detail page to pass the ItemID to a "select"
query, but how do I pass the ID to an "Insert" query?

I'd appreciate any hoep I can get on this one.
Thanks.
 
D

Dave Sussman

Jim

1. Yes, that's what I'd do; just have a FormView with the DefaultMode set to
Insert.
2. Pass the ItemID inthe same way, via the QueryString. Use a
QueryStringParameter in the InsertParameters, just as you would with a
select. When the insert command is executed, the parameter is just fetched
from the query string, rather than the form data.

d
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,070
Latest member
BiogenixGummies

Latest Threads

Top