C
CZuhars
Hi,
My .NET application writes to an Access 2003 db through OleDb. I'm
using a stored query in Access to insert a new row. The app's C# code
sample includes:
myCommand.CommandType = CommandType.StoreQuery;
myCommand.CommandText = "InsertName";
myCommand.Parameters.AddWithValue("@FIRST", "First name");
myCommand.Parameters.AddWithValue("@LAST", "Last name");
myCommand.Command.Open();
int rowNum = myCommand.ExecuteNonQuery(); // returns 1 row added
myCommand.Command.Close();
The Access Query - (an Append Query?) is:
INSERT INTO Members ( first_name, last_name )
SELECT [@FIRST] AS Expr1, [@LAST ]AS Expr2;
When the app runs, debug says the query returns a row. But when I
look at the table's data, nothing is there.
Any advice?
Thanks!
My .NET application writes to an Access 2003 db through OleDb. I'm
using a stored query in Access to insert a new row. The app's C# code
sample includes:
myCommand.CommandType = CommandType.StoreQuery;
myCommand.CommandText = "InsertName";
myCommand.Parameters.AddWithValue("@FIRST", "First name");
myCommand.Parameters.AddWithValue("@LAST", "Last name");
myCommand.Command.Open();
int rowNum = myCommand.ExecuteNonQuery(); // returns 1 row added
myCommand.Command.Close();
The Access Query - (an Append Query?) is:
INSERT INTO Members ( first_name, last_name )
SELECT [@FIRST] AS Expr1, [@LAST ]AS Expr2;
When the app runs, debug says the query returns a row. But when I
look at the table's data, nothing is there.
Any advice?
Thanks!