Dynamic SQL generation is not supported against a SelectCommand that does not return any base table information



Hi,
I have data access tier designed in such a way, just by changnging
application settings, same lines of code is made to work with both MS
SQL Server or MS Access. Code works fine with MS SQL Server. however
while executing following code lines on MS Acess

ds = new DataSet();
oAdapter.SelectCommand.CommandText = this.SelectCommand;
oAdapter.SelectCommand.Connection = oConn;

if (idbType == (int) ApplicationConstants.DBType.SQLServer)
{
oAdapter.DeleteCommand = sqlCommandBuilder.GetDeleteCommand();
oAdapter.InsertCommand =
sqlCommandBuilder.GetInsertCommand();
oAdapter.UpdateCommand =
sqlCommandBuilder.GetUpdateCommand();
}
else if (idbType == (int) ApplicationConstants.DBType.Access)
{
oAdapter.DeleteCommand =
oleCommandBuilder.GetDeleteCommand();
oAdapter.InsertCommand =
oleCommandBuilder.GetInsertCommand();
oAdapter.UpdateCommand =
oleCommandBuilder.GetUpdateCommand();
}

return oAdapter.Fill(ds);


It throws out the following error

System.InvalidOperationException was unhandled
Message="Dynamic SQL generation is not supported against a
SelectCommand that does not return any base table information."

But i have defined primary keys on all tables in Access databasel, just
like what i have in MS Sql database. Just to avoid this error i can
not use explict Insert, Delete or Update command for Adapter as the
same lines of code (above) has to work with 15 diff tables.

Any suggestions to this?

Thanks & Regards
Ganesh

.



Relevant Pages

  • Re: Tracking user activities
    ... >> I'd like these settings to persist permanently and the event records to ... > In SQL 2000, this is not very simple to do. ... > Erland Sommarskog, SQL Server MVP, esquel@xxxxxxxxxxxxx ... select Script Trace. ...
    (comp.databases.ms-sqlserver)
  • Re: Unable to Apply SP4 to SQL 2000 Cluster (new Node)
    ... Rebuild the node in the failover cluster. ... Scenario 1" in SQL Server 2000 Books Online. ... This setup process updates to SP4 only the binaries on the new ...
    (microsoft.public.sqlserver.clustering)
  • Re: WSS 3.0 question
    ... I followed the advise given in removing WSS 3.0 etc, ... the server is complaining that the SQL service(?) was tempered with or corrupt. ... I may just instal the SQL server as I was going eventuall use it anyway. ... If WSUS 3.0 is installed, I would suggest you uninstall it and then you install WSS 3.0. ...
    (microsoft.public.windows.server.sbs)
  • Re: SQL Server 2005 Cluster Setup Quiz
    ... I did test and it did not install the client tools. ... http://www.clusterhelp.com - Cluster Training ... Microsoft SQL Server MVP ... Provide a template on how to read SQL Server 2005 setup log files. ...
    (microsoft.public.sqlserver.clustering)
  • Re: WSUS
    ... I'm not seeing performance issues with the full enchilada installed, and 25 users busy hitting SQL. ... WSUS isn't difficult to uninstall - if you have WSUS v2 (installed with SBS R2) uninstall R2 from add/remove programs. ... How can anyone work with 4 instances of SQL Server on the same box? ...
    (microsoft.public.windows.server.sbs)