Desperately seeking Master Detail example.........PLEASEEE

Hi,

I am Having big problems with my master detail form.

When I add a new Parent record the Child datagrid does not fill with the foriegn keys!  Can anyone Help with examples of Master Detail Forms that use DataBinding Architecture  to Add, Edit Or Delete form the form.  The form uses a dataset with two tables that have a realtionship.  I can edit the Master and Detail, and the foriegn keys are present but I can not when im adding a new parent.

HELP  :(

Than you .
Nerdy_Girl88Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

RonaldBiemansCommented:
Hi Nerdy_Girl88,

look at this article  (both for sql server and access)

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnadonet/html/manidcrisis.asp
0
RonaldBiemansCommented:
By the way, there is a downloadable project in that link which you can try.
0
RonaldBiemansCommented:
Hi Nerdy_Girl, This is a big drawback of the disconnected model ADO.net uses, Fortunately the new version  of ADO.net will again have a connected option, which will make this problem much easier to handle. I had to handle this problem for a many to many relation and than the real horror begins ;-)
0
Cloud Class® Course: Ruby Fundamentals

This course will introduce you to Ruby, as well as teach you about classes, methods, variables, data structures, loops, enumerable methods, and finishing touches.

Nerdy_Girl88Author Commented:
Is this problem really that difficult ? I thought that my databinds would take care of the relationships between tow datatables.  WIth the Forign already defined by the relationship.

Huhhhhhhhh.  

Still Looking for examples that show me how Master Deatil forms work with databinding manager.  That will demonstate how to add edit and delete records.

Very frustared
0
RonaldBiemansCommented:
Yes it is, unless you can guaranty that no parent records are ever deleted.

About the examples have you tried the example that was in the link I send you ?
0
Nerdy_Girl88Author Commented:
Arrrrrrrrrrr, I Finally understand, I didn;t realsie the problem was actuall with the autoincrements!!!!!  How frustrating.  

I have down loaded that example but can't get it to run I think im missing the database.  So I haven't been able to see you get around this problem.  Are we on the same page now?  The dataset is trying to update to the database but the Auto increments for the PK IDs are different, when i go back to update.

Nerdy_Girl88
0
RonaldBiemansCommented:
Hi nerdy_girl,

In the code you only have to change the Sqlserver name and point to any database. The example will generate its own tables in the database.

you only have to change this line

cn = New SqlConnection("server=Yourservername;database=anydatabasename;integrated security=sspi")
0
Nerdy_Girl88Author Commented:
At the moment my dataAdapters hold all the databse SQl Can I still Implement it this way or Do I need to specifiy my sql statements to cater for this problem......Just started reading throught the code,  can you give an little overview of what eaxactly I am doing?

thanks I will give it a go
0
Nerdy_Girl88Author Commented:
I only have Access?  Do i replace the connection string with my Access connection?
0
RonaldBiemansCommented:
I'm not sure this code will work on an access database, I haven't tried that yet.

For this to work you have to write your own sql statement.

But maybe I can suggest another solution,

If you leave your master grid maybe you can save the records at that moment, and refresh yourdata in the update command.

this should give you the correct ID
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Nerdy_Girl88Author Commented:
So, maybe on cell change I can refresh the dataSet with the data.!  I'll give it a go!

Thanks.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic.NET

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.