Re: Syntax error (missing operator) when deleting a row with comma

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



Here's the deletecommand text that is generated by the command builder.
I have placed a post to the ADO.net guys as suggested.

DELETE FROM Spex WHERE ( (spex_id = ?) AND ((? = 1 AND Std_Name IS NULL) OR
(Std_Name = ?)) AND ((? = 1 AND ID IS NULL) OR (ID = ?)) AND ((? = 1 AND
400nm IS NULL) OR (400nm = ?)) AND ((? = 1 AND 410nm IS NULL) OR (410nm = ?))
AND ((? = 1 AND 420nm IS NULL) OR (420nm = ?)) AND ((? = 1 AND 430nm IS NULL)
OR (430nm = ?)) AND ((? = 1 AND 440nm IS NULL) OR (440nm = ?)) AND ((? = 1
AND 450nm IS NULL) OR (450nm = ?)) AND ((? = 1 AND 460nm IS NULL) OR (460nm =
?)) AND ((? = 1 AND 470nm IS NULL) OR (470nm = ?)) AND ((? = 1 AND 480nm IS
NULL) OR (480nm = ?)) AND ((? = 1 AND 490nm IS NULL) OR (490nm = ?)) AND ((?
= 1 AND 500nm IS NULL) OR (500nm = ?)) AND ((? = 1 AND 510nm IS NULL) OR
(510nm = ?)) AND ((? = 1 AND 520nm IS NULL) OR (520nm = ?)) AND ((? = 1 AND
530nm IS NULL) OR (530nm = ?)) AND ((? = 1 AND 540nm IS NULL) OR (540nm = ?))
AND ((? = 1 AND 550nm IS NULL) OR (550nm = ?)) AND ((? = 1 AND 560nm IS NULL)
OR (560nm = ?)) AND ((? = 1 AND 570nm IS NULL) OR (570nm = ?)) AND ((? = 1
AND 580nm IS NULL) OR (580nm = ?)) AND ((? = 1 AND 590nm IS NULL) OR (590nm =
?)) AND ((? = 1 AND 600nm IS NULL) OR (600nm = ?)) AND ((? = 1 AND 610nm IS
NULL) OR (610nm = ?)) AND ((? = 1 AND 620nm IS NULL) OR (620nm = ?)) AND ((?
= 1 AND 630nm IS NULL) OR (630nm = ?)) AND ((? = 1 AND 640nm IS NULL) OR
(640nm = ?)) AND ((? = 1 AND 650nm IS NULL) OR (650nm = ?)) AND ((? = 1 AND
660nm IS NULL) OR (660nm = ?)) AND ((? = 1 AND 670nm IS NULL) OR (670nm = ?))
AND ((? = 1 AND 680nm IS NULL) OR (680nm = ?)) AND ((? = 1 AND 690nm IS NULL)
OR (690nm = ?)) AND ((? = 1 AND 700nm IS NULL) OR (700nm = ?)) )
--
All the best
Hawkmoth


"Erland Sommarskog" wrote:

> Hawkmoth (Hawkmouth@xxxxxxxxxxxxx) writes:
> > I am creating a C# project that stores data into an Access database.
> >
> > I have created a dataset using an OleDbDataAdapter with a sql select
> > statment "SELECT table.* FROM table
> >
> > This table has a long Interger autonumbering ID key field, 1 text field, 1
> > Long Interger field, and 31 Double fields.
> >
> > I then use the Commandbuilder object to create the Insert, delete and
> > update commands.
> >
> > The Insert command seems to work ok as I can create a new row and use the
> > OleDbDataAdapter.update( ); with now problems
> >
> > My problem is that I get Syntax error (missing operator) when I attempt to
> > update a record set after deleting a row.
>
> So did you look at .UpdateCommand.CommandText and
> ..DeleteCommand.CommandText to see what's in there?
>
> In any case, you should be speaking with the people in
> microsoft.public.dotnet.framework.adonet. They know more about ADO .Net
> than we do over here.
>
>
>
> --
> Erland Sommarskog, SQL Server MVP, esquel@xxxxxxxxxxxxx
>
> Books Online for SQL Server SP3 at
> http://www.microsoft.com/sql/techinfo/productdoc/2000/books.asp
>
.



Relevant Pages