Re: System.InvalidOperationException when attempting to add a reco



Thanks for your answer. That along with other reading I have done has
indicated that I can't update FoxPro tables like I would like to using the
DataAdapter. For now, I changed it to use ADODB for my updates and that works
just fine.

"Val Mazur (MVP)" wrote:

> Hi,
>
> When you call Update method of the DataAdapter, then it tries to build
> INSERT, UPDATE and DELETE statements based on SELECT statement that selected
> data. But it does not work with all the providers and in all the situations.
> I believe you need to provide these SQL statements explicitly to resolve
> this issue
>
> --
> Val Mazur
> Microsoft MVP
>
> http://xport.mvps.org
>
>
>
> "JMB" <JMB@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
> news:E17A09F5-34D6-4419-B2D6-FA03A1A8AD44@xxxxxxxxxxxxxxxx
> >I am working on a VB.NET application that needs to add records to a FoxPro
> > table. I create a dataset, populate a DataRow and add it to the dataset.
> > Standard stuff I've done many times with SQL Server and Access databases.
> > When I do the Update method on the dataset I get the following error:
> > System.InvalidOperationException: Dynamic SQL generation is not supported
> > against a SelectCommand that does not return any base table information.
> >
> > I'm guessing it's because the base table does not have a primary key. The
> > table does have an index (CDX file). In FoxPro, I'd do a SET ORDER TO...
> > command to specify the index to use. If that is the problem, how would I
> > do
> > that in VB.NET?
> >
> > This table has 119 columns in it, many of which are text and can contain
> > any
> > user input values. As a result, I don't want to attempt to do a SQL Insert
> > Into command.
> >
> > Any suggestions? Thanks in advance.
> >
>
>
>
.



Relevant Pages

  • Re: System.InvalidOperationException when attempting to add a record
    ... When you call Update method of the DataAdapter, ... > Standard stuff I've done many times with SQL Server and Access databases. ... > against a SelectCommand that does not return any base table information. ... > command to specify the index to use. ...
    (microsoft.public.data.ado)
  • Re: COBOL stored procedure for DB2
    ... Regarding how you precompile the app, you must specify target mfcob to db2 prep, rather than target ibmcob. ... Have you also confirmed that, prior to executing the CALL statement, the host variables specified within the client app have the appropriate values? ... MODIFIES SQL DATA ... confirm the cob command used for creating the SP module. ...
    (comp.lang.cobol)
  • Re: COBOL stored procedure for DB2
    ... Have you also confirmed that, prior to executing the CALL statement, the ... The DB2 CREATE PROCEDURE statement. ... MODIFIES SQL DATA ... confirm the cob command used for creating the SP module. ...
    (comp.lang.cobol)
  • Re: Can I get Consultancy advice on SQL/Fox in the UK (South East)
    ... My problem is the two Sequel Server tables within one database with which I ... Don't ask me why but the SQL designers have NOT ... command that I can initiate with SQLCONNECT, ... > While you're in the View Designer, right-click and view the SQL code. ...
    (microsoft.public.fox.helpwanted)
  • Re: Optimistic Concurrency on UpdateCommand...
    ... client device, I update that column with a non-null datetime and then try to ... 1!!!If I copy and paste the command ... With the 4th column not allowing nulls, the optimistic concurrency code ... Can I have a nullable datetime column in my Sql ...
    (microsoft.public.dotnet.framework.adonet)