Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 259
  • Last Modified:

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 .
0
Nerdy_Girl88
Asked:
Nerdy_Girl88
  • 6
  • 5
1 Solution
 
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
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
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
 
Nerdy_Girl88Author Commented:
So, maybe on cell change I can refresh the dataSet with the data.!  I'll give it a go!

Thanks.
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 6
  • 5
Tackle projects and never again get stuck behind a technical roadblock.
Join Now