tonywilliams
Member
- Joined
- Feb 12, 2007
- Messages
- 9
- Programming Experience
- 3-5
I am new to .net and am struggling along very slowly using datasets and adaptors etc. So first of all if anyone knows of any good tutorials it would be of great help.
But my problem at the moment is using a dataset which is filled with more than one table. My table adaptor uses a query which selects a single record from a table which has a relationship with a second table.
Everything works fine and I am getting all the data I need but its just referencing it that I am having trouble with. I can reference the additional table by accessing its column number, however I want to be able to access it through its name, like I can with the other table.
Here is my current code for the Fill
Me.Customer_detailsTableAdapter1.FillBycustref(Me.Comfortplus_customer_databaseDataSet_products.customer_details, txt_ref.Text)
Dim rowView As DataRowView = CType(Me.Customer_detailsBindingSource.Current, DataRowView)
Dim custRow As comfortplus_customer_databaseDataSet_products.customer_detailsRow = CType(rowView.Row, comfortplus_customer_databaseDataSet_products.customer_detailsRow)
The other table is "tbl_salesman" and I can get the value I need by referencing it as :
Me.Comfortplus_customer_databaseDataSet_products.customer_details.Rows(0).Item(25)
But how can i set it up so i can access it via the actual field name. ie tbl_salesman.salesman_name.
Many Thanks
But my problem at the moment is using a dataset which is filled with more than one table. My table adaptor uses a query which selects a single record from a table which has a relationship with a second table.
Everything works fine and I am getting all the data I need but its just referencing it that I am having trouble with. I can reference the additional table by accessing its column number, however I want to be able to access it through its name, like I can with the other table.
Here is my current code for the Fill
Me.Customer_detailsTableAdapter1.FillBycustref(Me.Comfortplus_customer_databaseDataSet_products.customer_details, txt_ref.Text)
Dim rowView As DataRowView = CType(Me.Customer_detailsBindingSource.Current, DataRowView)
Dim custRow As comfortplus_customer_databaseDataSet_products.customer_detailsRow = CType(rowView.Row, comfortplus_customer_databaseDataSet_products.customer_detailsRow)
The other table is "tbl_salesman" and I can get the value I need by referencing it as :
Me.Comfortplus_customer_databaseDataSet_products.customer_details.Rows(0).Item(25)
But how can i set it up so i can access it via the actual field name. ie tbl_salesman.salesman_name.
Many Thanks