E
Eric Kiernan
i'm using mdb files for a local database. i have a database called
BudgetSavings, and a table called BudgetSpending. it blows up on
executing an SQL command. below is the code:
string conStr = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\\C#
u008\\BudgetSavings\\BudgetSavings\\BudgetSavings.mdb";
OleDbConnection objConnection = new OleDbConnection(conStr);
objConnection.ConnectionString = conStr;
//objConnection.Close();
objConnection.Open();
string strSQL = "INSERT INTO BudgetSpending (Year) VALUES
('1964')"; // year is a 4 character text field.
OleDbCommand objCommand = new OleDbCommand();
objCommand.CommandText = strSQL;
objCommand.CommandType = CommandType.Text;
objCommand.Connection = objConnection;
int x = objCommand.ExecuteNonQuery(); / it blows up here
with error:Syntax error in 'INSERT INTO statement"
I'm scratching my head over this. also, if someone knows of a good sql
group, let me now.
BudgetSavings, and a table called BudgetSpending. it blows up on
executing an SQL command. below is the code:
string conStr = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\\C#
u008\\BudgetSavings\\BudgetSavings\\BudgetSavings.mdb";
OleDbConnection objConnection = new OleDbConnection(conStr);
objConnection.ConnectionString = conStr;
//objConnection.Close();
objConnection.Open();
string strSQL = "INSERT INTO BudgetSpending (Year) VALUES
('1964')"; // year is a 4 character text field.
OleDbCommand objCommand = new OleDbCommand();
objCommand.CommandText = strSQL;
objCommand.CommandType = CommandType.Text;
objCommand.Connection = objConnection;
int x = objCommand.ExecuteNonQuery(); / it blows up here
with error:Syntax error in 'INSERT INTO statement"
I'm scratching my head over this. also, if someone knows of a good sql
group, let me now.