gmcconville
November 22nd, 2011, 12:39 AM
Hey, I have searched for ages on this but cannot get it working.
I have two tables, one called Fields and another called Sections.
There is a relationship between the two table for a field called section.
I have a binding navigator on the form that is used to cycle through the different records in Fields.
I have a bunch of text boxes that properly display the information of the Fields correctly
I also have a combo box that I cannot get working, I need it to display the items on from the Sections table.
I am trying to code everything, so no wizards used.
This is what I have been trying so far
BSource = new BindingSource();
BSource.DataSource = DbDataSet.Tables["Fields"];
Navigator.BindingSource = BSource;
BSource2 = new BindingSource();
BSource2.DataSource = DbDataSet.Tables["Sections"];
// CbSections is the combobox
CbSections.DataSource = BSource2;
CbSections.DataBindings.Add("Text", BSource, "Section");
CbSections.DisplayMember = "Sections.Section";
Also. Can sombody please recommend a good ADO.NET book.
I am looking at buying Sams Teach Youself ADO.NET in 21 days, however it is expensive and I don't want to get it only to find it is not any good.
Thanks for all help.
I have two tables, one called Fields and another called Sections.
There is a relationship between the two table for a field called section.
I have a binding navigator on the form that is used to cycle through the different records in Fields.
I have a bunch of text boxes that properly display the information of the Fields correctly
I also have a combo box that I cannot get working, I need it to display the items on from the Sections table.
I am trying to code everything, so no wizards used.
This is what I have been trying so far
BSource = new BindingSource();
BSource.DataSource = DbDataSet.Tables["Fields"];
Navigator.BindingSource = BSource;
BSource2 = new BindingSource();
BSource2.DataSource = DbDataSet.Tables["Sections"];
// CbSections is the combobox
CbSections.DataSource = BSource2;
CbSections.DataBindings.Add("Text", BSource, "Section");
CbSections.DisplayMember = "Sections.Section";
Also. Can sombody please recommend a good ADO.NET book.
I am looking at buying Sams Teach Youself ADO.NET in 21 days, however it is expensive and I don't want to get it only to find it is not any good.
Thanks for all help.