J
James Alba
Hey all,
I am accessing an ms access database using .NET and C#. Like so,
/* Create the database connection. */
connection = new OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data
Source=" + Name);
connection.Open();
And all is good.
My "ticket" table has the setup: auto number (PK), name and event_id.
I am successfully inserting records into the "ticket" table, BUT HOW can I
get the auto number of my PK that MS Access assigns???
I really need this PK!!!
for (int i = 0; i < j; ++i)
{
OleDbCommand c = new OleDbCommand("insert into ticket (name, event)
values('" + Customer + "', '" + ID + "')", connection);
c.ExecuteNonQuery();
}
Thankyou all!
I am accessing an ms access database using .NET and C#. Like so,
/* Create the database connection. */
connection = new OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data
Source=" + Name);
connection.Open();
And all is good.
My "ticket" table has the setup: auto number (PK), name and event_id.
I am successfully inserting records into the "ticket" table, BUT HOW can I
get the auto number of my PK that MS Access assigns???
I really need this PK!!!
for (int i = 0; i < j; ++i)
{
OleDbCommand c = new OleDbCommand("insert into ticket (name, event)
values('" + Customer + "', '" + ID + "')", connection);
c.ExecuteNonQuery();
}
Thankyou all!