PC Review


Reply
Thread Tools Rate Thread

ADO.NET 2.0 Automatically insert records into child table

 
 
=?Utf-8?B?SFNB?=
Guest
Posts: n/a
 
      23rd Nov 2005
Hello !

I've info in 3 tables of SQL database:
1. Users (user_id, login, private_flag, ...)
2. Private (user_id, name, e_mail, ...)
3. Business (user_id, account_number, bank_name, ...)

If Users.private_flag equals to 1 then attributes of user are in "Private"
table,
if it's 0 - in Business one.
I created a Windows Form where the main table is Users.
And both Private and Business tables are attached to it with a DataRelation-s.

When "+" button is pressed in BindingNavigator for Users table I need to
insert new record into Private or Business automatically when user selects a
value for Users.private_flag.

I tried to use various events of BindingSource, DataTable and etc. and
insert new record to one of child tables but all was helpless.
New record always not inserted.
I also noticed that new record not appears in Users table until anotrher
record of Users is selected with BindingNavigator.

Does anybody know how to realize such a logic ?
Or how to allow user to enter Private/Business data after pressing the "+"
on Users ?
Or where can I read more regarding this ?

Thanks.
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

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
Insert into - the rows of a table back into a table Parent Child Bill Microsoft Access VBA Modules 0 27th Nov 2008 02:22 AM
LINQDataSource / FormView - automatically updating child records Jay Pondy Microsoft ASP .NET 0 4th Apr 2008 12:27 PM
updating child records in a DataSet w/ new autoinc values after parent insert? Chris Bordeman Microsoft Dot NET Framework 3 22nd Nov 2006 04:47 AM
Insert records in Parent and child tables =?Utf-8?B?U3VqYWw=?= Microsoft Access Queries 5 29th Apr 2006 11:07 PM
Automatically insert child record Joe Williams Microsoft Access Form Coding 0 6th Dec 2004 07:37 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 05:29 AM.