Data Binding

dazlerd

Well-known member
Joined
Sep 29, 2006
Messages
52
Programming Experience
5-10
Hi

I have a CompanyForm that shows details on the company in a groupBox and a set of tab controls. One of these tabs is labelled 'Notes' and contains a listview with all the notes on the company.

When the company form is opened I populate a dataset with a dataTable containing all the notes for the company using a SQLDataAdapter. Now when I edit a note I want a new form to show, which contains text fields for all the notes records and a bindaing navigator to scroll through these records.

I have created a new dataset, bindingsource, tableadapter, and binding navigator by dragging and dropping the table and I have created 2 new queries in the dataadapter. One to retrieve all notes for company and the other to retrieve all notes for the company created by the current user.

Questions:

1) How do I add the companyId into the dataadapter when the bindingnavigator is saving the record? Where do I write my Insert statement? I get a companyId cannot be null error.

2) When the user clicks the 8th note in the company notes listview how do I get the binding navigator to show the 8th note instead of the 1st?

3) Ive also got another form 'Activities' that needs to show the notes associated with it and the company id. Can I share the dataset etc between the two forms. The company can have many activities and each activity many notes. All notes are shown in the notes listview.

4) Ive already got the notes table in my dataset when showing the notes in the company form, can i use this in the notes form instead of creating a new dataset?

5) I have more questions but id really like to sort out the main ones first!!

The rest of the application works great using datasets, datatables etc but Im trying to use the navigator and do things using the IDE. I havent dabbled with this before so im confused. If I was doing it in code Id pass my dataset from company into notes and show them from that but I want to learn!!

Any help/advice would be great

Thanks very much

D
 
Back
Top