473,378 Members | 1,623 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

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

Mar 4 '06 #1
0 5770

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: JDPope | last post by:
I have a situation which I cannot get a good lead on how to resolve. One of the applications I support uses the Hibernate software to generate SQL. The app is JAVA with JDBC. In testing the users...
11
by: Marco Loskamp | last post by:
Dear list, I'm trying to dynamically generate functions; it seems that what I really want is beyond C itself, but I'd like to be confirmed here. In the minimal example below, I'd like to...
1
by: sleigh | last post by:
Hello, I'm building a web application that will build a dynamic form based upon questions in a database. This form will have several different sections that consist of a panel containing one to...
4
by: DraguVaso | last post by:
Hi, For my VB.NET application I have the following situation: 2 tables on my SQL Server: tblAccounts and tblRules. For each Account there are many Rules (so tblRules is linked to my tblAccounts...
2
by: Irfan | last post by:
hi, I am getting the following error. Dynamic SQL generation is not supported against a SelectCommand that does not return any base table information when i try to use da.update I squeezed...
4
by: Chris | last post by:
Can't seem to figure out how to do this and have been reading for some time now...... I want to select a row count from a table name in SYSTABLES. This statement does not return what I needed,...
5
by: =?Utf-8?B?QUEyZTcyRQ==?= | last post by:
The full error message is "Dynamic SQL generation for the UpdateCommand is not supported against a SelectCommand that does not return any key column information." I am getting this error when...
0
by: pieandpeas | last post by:
Hi, I'm having a problem with my code, I am doing the following - retrieving a field from a table, which is linked to another table, i'm only updating one of the fields in one of the two tables......
16
OuTCasT
by: OuTCasT | last post by:
Anyone know how to get passed this prblem Dynamic SQL generation is not supported against multiple base tables
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.