Re: Question related to OleDbDataAdapter.Update

From: James (James_at_discussions.microsoft.com)
Date: 08/26/04


Date: Thu, 26 Aug 2004 04:57:11 -0700

Why?

Rows that have been deleted or updated are all working properly. Only I add
new rows that would cause an exception? And I have checked the comandtext. It
seems that the syntax are all correct.

"Erland Sommarskog" wrote:

> James (James@discussions.microsoft.com) writes:
> > Originally I use ODBC connection to access the MS access file, but I
> > changed it to OleDbconnection just now and set the data provider to be
> > MS Jet 4.0.
> >
> > Here is the problem:
> >
> > I use a select statement to fill a datatable (eg. sql = "select * from
> > orderdetails where orderid = " & orderid), which would be modified by
> > the user in the GUI level. After the modification (insertion), I use
> > OleDbDataAdapter.Update to update the database, and it returns an error
> > saying that "Syntax error in insert statement".
> >
> > It runs properly if I used ODBCconnection. Any suggestion on that? Thanks
>
> Another question that would be better directed to
> microsoft.public.dotnet.framework.adonet, I think.
>
> I would examine what you have in the .UpdateCommand of the DataAdapter,
> and change it if necessary.
>
>
>
> --
> Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se
>
> Books Online for SQL Server SP3 at
> http://www.microsoft.com/sql/techinfo/productdoc/2000/books.asp
>



Relevant Pages

  • Re: Error: 16954, Severity: 10, State: 1 and Timeout problem
    ... On this DB are runing lot of threads from different applications. ... Probably, other aplication are locking resources, so the first one need ... Erland Sommarskog, SQL Server MVP, esquel@xxxxxxxxxxxxx ...
    (comp.databases.ms-sqlserver)
  • Re: Systematically determine DRI problem(s)
    ... "the original designer probably meant to link them via customer_ID" ... Erland Sommarskog wrote: ... >> of effort to find data problem for the given situation, ... > Erland Sommarskog, SQL Server MVP, esquel@xxxxxxxxxxxxx ...
    (comp.databases.ms-sqlserver)
  • Re: Grant access to applications only
    ... but to deny a direct user login e.g. via management studio. ... Erland Sommarskog, SQL Server MVP, esquel@xxxxxxxxxxxxx ... Books Online for SQL Server 2005 at ...
    (microsoft.public.sqlserver.security)
  • Re: MS Access Multiuser Example
    ... They didn't want to reinvent the wheel. ... I built a web application using an MS Access file as the ... I ended up redoing both apps using the MSDE and MS SQL Server respectively. ...
    (microsoft.public.dotnet.framework.adonet)
  • Re: ALTER PARTITION FUNCTION PartFunc() MERGE RANGE & blocking
    ... I hope MS fix this livelock problem in the next service pack. ... Erland Sommarskog, SQL Server MVP, esquel@xxxxxxxxxxxxx ... Books Online for SQL Server 2005 at ...
    (microsoft.public.sqlserver.tools)

Quantcast