OleDbCommandBuilder problem with views in SqlExpress [modified]
-
Hi all, I'm using OleDbCommandBuilder to build commands for an OleDbDataAdapter automatically The problem is when using OleDbDataAdapter to retrieve data from a "View" in a SQL Express database Ex: OleDbDataAdapter("select * from ViewName", ConnectionString); The generated CommandText for generated commands is invalid, it looks like this: InsertCommand ex: INSERT INTO D:\\FOLDER_NAME\\DATABASE_FILE_NAME.MDF.dbo.TableName DeleteCommand ex: DELETE FROM D:\\FOLDER_NAME\\DATABASE_FILE_NAME.MDF.dbo.TableName UpdateCommand ex: UPDATE D:\\FOLDER_NAME\\DATABASE_FILE_NAME.MDF.dbo.TableName Where TableName is the source table of the "View" !!! Ofcource executing command causes an error of "Incorrect syntax near 'D:'" Notice that, this problem doesn't occur with tables, only with views !! Also problem doesn't occur with SqlCommandBuilder, but I need to use OleDbCommandBuilder because I'm dealing with multiple database providers Please help
modified on Sunday, May 18, 2008 6:45 AM
-
Hi all, I'm using OleDbCommandBuilder to build commands for an OleDbDataAdapter automatically The problem is when using OleDbDataAdapter to retrieve data from a "View" in a SQL Express database Ex: OleDbDataAdapter("select * from ViewName", ConnectionString); The generated CommandText for generated commands is invalid, it looks like this: InsertCommand ex: INSERT INTO D:\\FOLDER_NAME\\DATABASE_FILE_NAME.MDF.dbo.TableName DeleteCommand ex: DELETE FROM D:\\FOLDER_NAME\\DATABASE_FILE_NAME.MDF.dbo.TableName UpdateCommand ex: UPDATE D:\\FOLDER_NAME\\DATABASE_FILE_NAME.MDF.dbo.TableName Where TableName is the source table of the "View" !!! Ofcource executing command causes an error of "Incorrect syntax near 'D:'" Notice that, this problem doesn't occur with tables, only with views !! Also problem doesn't occur with SqlCommandBuilder, but I need to use OleDbCommandBuilder because I'm dealing with multiple database providers Please help
modified on Sunday, May 18, 2008 6:45 AM
Please Help