Bob,
For the text boxes, combo's etc ... I will put them into a GroupBox and
use the GroupBoxes visible property in code to show each consecutive group
of textboxes. Each group of textboxes will be bound to individual tables.
That is a hell of a job. However I think that it goes to far as I suggest
you to change that approach
You are also correct in asuming that each table has an ID field (ClientID)
that is the same in all the tables.
So the where clause is a ? in all tables and you set from every table the
parameter correct to the correct idea (see the sample I show you bellow for
that)
Each child table will have only one record relating to the parent table
when everything is working properly.
I don't see why you need a relation, when you have 11 tables, than you can
just fill 11 tables and update 11 tables. It is not the nicest approach
however you have your 255 limit problem.
I tried using the Bindingcontext with row positioning but often, it caused
problems because multiple users will be using it.
If you read only one row from each tables with the "where" the clientid than
you have in my idea less update problems.
This is a databindingcontext for a textbox
TextBox1.DataBindings.Add(New Binding("Text", ds.Tables(0), "City"))
Dont't forget that you do in this approach for every update with the
dataadadapter
\\\
for i as integer = i to ds.tables.count -1
BindingContext(ds.Tables(i)).EndCurrentEdit()
next
///
This pushes the data from a textbox that not yet lost focus in the
datatable.
In some cases, for some strange reason, all the child tables didn't get a
new record in the right sequence. That means that in some tables, record
number 327 in the parent table would display record number 327 in a child
table with the wrong ClientID.
I would use the oledbconnection rollback method
http://msdn.microsoft.com/library/d...taoledboledbtransactionclassrollbacktopic.asp
Also, a recent power failure caused me to have to go to the client
location and manualy add records to 11 tables in the proper position so
they displayed properly in the VB form.
As you can see, what I've been trying to do is fill the DA for the parent
table, get the ClientID into a variable, and pass it to a param that I
created in designer for the child table.
I built the relation and the params in designer using the Schema designer.
Gave it a name "PK_ClientID"
As I said I don't see the need for a relation, I would take them directly
using the ID.
Although that this is a sample beneath is for non typed dataset (not by the
designer created dataadapters, can you see in this sample see how to use
parameters.
http://www.windowsformsdatagridhelp.com/default.aspx?ID=550279ec-6767-44ff-aaa3-eb8b44af0137
I know this is not complete, however it becomes in my opinion to much I hope
it helps so far something.
Cor