insert new record in detailsview - how to get master id

G

Guest

Here is the problem:

Using asp.net 2.0 to create a web app with standard master table gridview
and child detailsview with insert capability.
SQL Server 2000 database on the backend. Using Visual Web Developer for
front-end development.

I want to insert new records in detailsview based on selected gridview
record. All the fields in "INSERT" mode are blank, which is okay EXCEPT that
I want the child ID to be that of the selected gridview record. For example,
to put a new order for customer with customerID 367, I need 367 to be
inserted in the new Orders record.

This is a very standard database and application design problem, but can't
seem to get a solution for it.

Please help if you can

Best -

jayd
 
R

Richard Carpenter

Can anyone answer this one? I am facing the same scenario. When I click
Insert on my child formview control, I get an error stating that it
cannot insert null into the parent key field in the child table. Where
do I make the connection between the parent formview data and the child
formview data?

I have the datasource for the child formview configured to use the
parent formview control for it's where clause expression, and, where
child records already exist, it works fine, but I can't get it to
insert a new record successfully in either case.

Rich
 

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,968
Messages
2,570,153
Members
46,701
Latest member
XavierQ83

Latest Threads

Top