Inserting and retrieving values
- From: "Keon" <keon@xxxxxxxxxxxxxx>
- Date: Thu, 17 Jan 2008 14:55:09 -0600
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.
ParentID.Value = Table1.FieldID value (how do you do this?)
Can someone help me out with this?
Thanks
.
- Follow-Ups:
- Re: Inserting and retrieving values
- From: Bob Barrows [MVP]
- Re: Inserting and retrieving values
- Prev by Date: Re: Incorect ADO connection status after network connection fail.
- Next by Date: Re: How to Data Bind (C# or VB) a ComboBox?
- Previous by thread: Re: Incorect ADO connection status after network connection fail.
- Next by thread: Re: Inserting and retrieving values
- Index(es):
Relevant Pages
|
|