G
Guest
I don't know if there is a solution to this question, but I am hoping there
is.
What I would like to know is the follow.
I made thru Access a database with 1 tablel having a primary key (column is
called mainID) and another table having a foreigner key (using OleDB
statements to read and write). I gave the primary key column autonummering.
This works great because I dont have to worry about the nummering of the
primary key table, its all done automatic, when using the
OleDbAdapter.Update() statement. The only problem is that when I create a 2
new rows 1 in each table. I can't get the foreigner key tablel to
automaticaly take the same nummer as the primary key.
Does anyone know if this is possible or will I have to use something else
than autonummering and take care of the linking myself with something like
this
int counter = 0;
DataRow drNewRow1 = myDataSet.Tables["Table1"].NewRow();
DataRow drNewRow2 = myDataSet.Tables["Table2"].NewRow();
drNewRow1["mainID"] = counter++; { primary key column}
drNewRow2["mainID"] = drNewRow1; { foreign key column}
Bardo
is.
What I would like to know is the follow.
I made thru Access a database with 1 tablel having a primary key (column is
called mainID) and another table having a foreigner key (using OleDB
statements to read and write). I gave the primary key column autonummering.
This works great because I dont have to worry about the nummering of the
primary key table, its all done automatic, when using the
OleDbAdapter.Update() statement. The only problem is that when I create a 2
new rows 1 in each table. I can't get the foreigner key tablel to
automaticaly take the same nummer as the primary key.
Does anyone know if this is possible or will I have to use something else
than autonummering and take care of the linking myself with something like
this
int counter = 0;
DataRow drNewRow1 = myDataSet.Tables["Table1"].NewRow();
DataRow drNewRow2 = myDataSet.Tables["Table2"].NewRow();
drNewRow1["mainID"] = counter++; { primary key column}
drNewRow2["mainID"] = drNewRow1; { foreign key column}
Bardo