R
richy_latham
Hi
I'm hoping this has a nice easy solution. I have a small C# app that
adds some rows to an Access database. Only problem is one of the
columns was originally named "Parent Alias".
When I went to update it I get the following error message "An
unhandled exception of type 'System.Data.OleDb.OleDbException' occurred
in system.data.dll"
I do Quick Watch on the dataset and when I drill down to
tables>List>Rows>RowError I can see this text "Syntax error (missing
operator) in query expression '@Parent Alias'."
This is the current insert command SQL query text "INSERT INTO
Paths(Alias,[Parent Alias],Engineer) VALUES (@Alias,@Parent
Alias,@Engineer)",connection);"
And this is the text for the parameter
....new OleDbParameter("@Parent Alias",OleDbType.VarChar,19,"[Parent
Alias]");
I've tried all sorts of combinations of square brackets both in the SQL
and in the parameter for @Parent Alias.
If I change Parent Alias to ParentAlias in the database and code it
works fine so it has to be the space in the column header.
Anyone know a way of working around this at all please?
Thanks
Rich
I'm hoping this has a nice easy solution. I have a small C# app that
adds some rows to an Access database. Only problem is one of the
columns was originally named "Parent Alias".
When I went to update it I get the following error message "An
unhandled exception of type 'System.Data.OleDb.OleDbException' occurred
in system.data.dll"
I do Quick Watch on the dataset and when I drill down to
tables>List>Rows>RowError I can see this text "Syntax error (missing
operator) in query expression '@Parent Alias'."
This is the current insert command SQL query text "INSERT INTO
Paths(Alias,[Parent Alias],Engineer) VALUES (@Alias,@Parent
Alias,@Engineer)",connection);"
And this is the text for the parameter
....new OleDbParameter("@Parent Alias",OleDbType.VarChar,19,"[Parent
Alias]");
I've tried all sorts of combinations of square brackets both in the SQL
and in the parameter for @Parent Alias.
If I change Parent Alias to ParentAlias in the database and code it
works fine so it has to be the space in the column header.
Anyone know a way of working around this at all please?
Thanks
Rich