Re: Question related to OleDbDataAdapter.Update
From: James (James_at_discussions.microsoft.com)
Date: 08/26/04
- Next message: Jean-Yves: "Amazing "Object reference not set to an instance of an object" err"
- Previous message: Markus Eßmayr: "Thread hangs inside SDK function"
- In reply to: Erland Sommarskog: "Re: Question related to OleDbDataAdapter.Update"
- Next in thread: Erland Sommarskog: "Re: Question related to OleDbDataAdapter.Update"
- Reply: Erland Sommarskog: "Re: Question related to OleDbDataAdapter.Update"
- Messages sorted by: [ date ] [ thread ]
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
>
- Next message: Jean-Yves: "Amazing "Object reference not set to an instance of an object" err"
- Previous message: Markus Eßmayr: "Thread hangs inside SDK function"
- In reply to: Erland Sommarskog: "Re: Question related to OleDbDataAdapter.Update"
- Next in thread: Erland Sommarskog: "Re: Question related to OleDbDataAdapter.Update"
- Reply: Erland Sommarskog: "Re: Question related to OleDbDataAdapter.Update"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|
|