Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > insert new record in detailsview - how to get master id

Reply
Thread Tools

insert new record in detailsview - how to get master id

 
 
=?Utf-8?B?SmF5RA==?=
Guest
Posts: n/a
 
      07-03-2006
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
 
Reply With Quote
 
 
 
 
Richard Carpenter
Guest
Posts: n/a
 
      07-10-2006
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


JayD wrote:
> 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


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: How include a large array? Edward A. Falk C Programming 1 04-04-2013 08:07 PM
DetailsView - How do I get the new record's ID after Insert? MU ASP .Net 1 01-26-2009 03:30 PM
Make new record current in DetailsView after Insert Hanno ASP .Net Datagrid Control 0 08-04-2006 11:00 PM
DetailsView - Changing to Insert Mode (Not By Using the Insert Button In the DetailsView Control) Feege ASP .Net Web Controls 0 12-20-2005 12:28 AM
How to insert a new record in detailsview when there are no record Frits van Soldt ASP .Net Web Controls 2 11-17-2005 09:18 AM



Advertisments