Question Newbie question about Ado.net

IrfanFaruki

New member
Joined
Mar 5, 2009
Messages
1
Programming Experience
Beginner
Hi Everyone,
I am a VB.NET newbie and i am trying to create a reciprocal link program for myself. What i want to do is for each site, i want to record the details of the site who i have done reciprocal link exchange with.

To achieve this, I have created two tables as below.

Name =Site_Details
Fields: ID ( Primary Key), Site_Name, Site_URL,RP_id

Name= Reciprocal_Details
Fields= RP_id(Primary Key), Site_URL,Reciprocal_URL,

I then created a relation between Site_details & Reciprocal_Details table on RP_id with Site_Details as primary table.

Than from data source viewer i dragged Site_details as Detail view on form for data entry and i dragged Reciprocal_details as Data grid view on the form

The problem i am having is that when i click on add new button on the navigator bar, the Data grid view is not updated to allow me to enter reciprocal relating to the new site.

Can anyone please tell me what i am doing wrong?

Thanks
 
Would need to see more of how you coded this (saving of the new record & how the grid is bound) to give a response.
 
Than from data source viewer i dragged Site_details as Detail view on form for data entry and i dragged Reciprocal_details as Data grid view on the form

...

Can anyone please tell me what i am doing wrong?


I bet you dragged the Reciprocal_details from the highest node level on the datasource viewer, rather than the one nested under Site_details

As a result, your Reciprocal_details grid on the form is bound to a bindingsource, that is bound straight to a datatable

To work with the relation, the bindingsource needs to be bound to the parent bindingsource, and have its datamember set to the name of the relationship. This is done for you if you drag the nested Reciprocal_details rather than the top level one

For more info read the DW2 link in my sign, section "Displaying Related Data"

Or if youre confused, go to Data Sources and expand every node in the tree and take a closer look..
 
Back
Top