K
Keon
I am trying to figure out the following information when storing some info
to the database, I don't know how to do this and therefore I am stuck.
I am going to try and explain this to the best of my ability.
I have two tables in my db, my first table I am writing the following
information to it.
ex....
// table one
FieldID, fName, lName, Address, State, Zip;
// table two
ParentID, Data;
// FieldID is an auto generated int field
FieldID.Value = 0;
fName.Value = "Jim";
lName.Value = "Anderson";
Address.Value = "747 Quarry Rd";
State.Value = "GH";
Zip.Value = "83920";
cmd.ExecuteNonQuery();
This is where I run into problems. For my second table, I need to get the
same FieldID value for ParentID. How do I go about that? And I am really
unsure on how
to write to two different tables at the same time. Not at the same time,
but one after the
other. After I do the cmd.ExecuteNonQuery() on the first table, what do I
do for the second
table?
ParentID.Value = Table1.FieldID value (how do you do this?)
Can someone help me out with this?
Thanks
to the database, I don't know how to do this and therefore I am stuck.
I am going to try and explain this to the best of my ability.
I have two tables in my db, my first table I am writing the following
information to it.
ex....
// table one
FieldID, fName, lName, Address, State, Zip;
// table two
ParentID, Data;
// FieldID is an auto generated int field
FieldID.Value = 0;
fName.Value = "Jim";
lName.Value = "Anderson";
Address.Value = "747 Quarry Rd";
State.Value = "GH";
Zip.Value = "83920";
cmd.ExecuteNonQuery();
This is where I run into problems. For my second table, I need to get the
same FieldID value for ParentID. How do I go about that? And I am really
unsure on how
to write to two different tables at the same time. Not at the same time,
but one after the
other. After I do the cmd.ExecuteNonQuery() on the first table, what do I
do for the second
table?
ParentID.Value = Table1.FieldID value (how do you do this?)
Can someone help me out with this?
Thanks