Re: System.InvalidOperationException when attempting to add a record
- From: "Val Mazur \(MVP\)" <group51a@xxxxxxxxxxx>
- Date: Wed, 29 Jun 2005 22:45:40 -0400
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.
>
.
- Follow-Ups:
- References:
- Prev by Date: Re: Which Error object
- Next by Date: Re: HOW DO I EDIT A RECORD IN ADO
- Previous by thread: System.InvalidOperationException when attempting to add a record
- Next by thread: Re: System.InvalidOperationException when attempting to add a reco
- Index(es):
Relevant Pages
|
|