This is a multi-part message in MIME format.
------=_NextPart_000_0000_01C4DC3C.8D141AB0
Content-Type: text/plain;
charset="us-ascii"
Content-Transfer-Encoding: 7bit
Hi,
I am using access as the main DB for an application.
Whenever I try to update the DB by my Dataset I get Exception below.
--------------
An unhandled exception of type 'System.Data.DBConcurrencyException'
occurred in system.data.dll
Additional information: Concurrency violation: the DeleteCommand
affected 0 records.
--------------
What worries me is the "?" in the SQL below of the Update Command? Is
this normal?
I just cannot get my head around the "?"
All the code below was generated by Visual Studio.
Do I have to modify this or am I doing something Wrong?
Thanks in Advance.
'OleDbUpdateCommand1
'
Me.OleDbUpdateCommand1.CommandText = "UPDATE Reminders SET ReminderDate
= ?, ReminderTime = ?, Route = ? WHERE (EventID" & _
" = ?) AND (ReminderDate = ? OR ? IS NULL AND ReminderDate IS NULL) AND
(Reminder" & _
"Time = ? OR ? IS NULL AND ReminderTime IS NULL) AND (Route = ? OR ? IS
NULL AND " & _
"Route IS NULL)"
Me.OleDbUpdateCommand1.Connection = Me.OleDbConnection
Me.OleDbUpdateCommand1.Parameters.Add(New
System.Data.OleDb.OleDbParameter("ReminderDate",
System.Data.OleDb.OleDbType.DBDate, 0, "ReminderDate"))
Me.OleDbUpdateCommand1.Parameters.Add(New
System.Data.OleDb.OleDbParameter("ReminderTime",
System.Data.OleDb.OleDbType.DBDate, 0, "ReminderTime"))
Me.OleDbUpdateCommand1.Parameters.Add(New
System.Data.OleDb.OleDbParameter("Route",
System.Data.OleDb.OleDbType.VarWChar, 50, "Route"))
Me.OleDbUpdateCommand1.Parameters.Add(New
System.Data.OleDb.OleDbParameter("Original_EventID",
System.Data.OleDb.OleDbType.Integer, 0,
System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0,
Byte), "EventID", System.Data.DataRowVersion.Original, Nothing))
Me.OleDbUpdateCommand1.Parameters.Add(New
System.Data.OleDb.OleDbParameter("Original_ReminderDate",
System.Data.OleDb.OleDbType.DBDate, 0,
System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0,
Byte), "ReminderDate", System.Data.DataRowVersion.Original, Nothing))
Me.OleDbUpdateCommand1.Parameters.Add(New
System.Data.OleDb.OleDbParameter("Original_ReminderDate1",
System.Data.OleDb.OleDbType.DBDate, 0,
System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0,
Byte), "ReminderDate", System.Data.DataRowVersion.Original, Nothing))
Me.OleDbUpdateCommand1.Parameters.Add(New
System.Data.OleDb.OleDbParameter("Original_ReminderTime",
System.Data.OleDb.OleDbType.DBDate, 0,
System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0,
Byte), "ReminderTime", System.Data.DataRowVersion.Original, Nothing))
Me.OleDbUpdateCommand1.Parameters.Add(New
System.Data.OleDb.OleDbParameter("Original_ReminderTime1",
System.Data.OleDb.OleDbType.DBDate, 0,
System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0,
Byte), "ReminderTime", System.Data.DataRowVersion.Original, Nothing))
Me.OleDbUpdateCommand1.Parameters.Add(New
System.Data.OleDb.OleDbParameter("Original_Route",
System.Data.OleDb.OleDbType.VarWChar, 50,
System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0,
Byte), "Route", System.Data.DataRowVersion.Original, Nothing))
Me.OleDbUpdateCommand1.Parameters.Add(New
System.Data.OleDb.OleDbParameter("Original_Route1",
System.Data.OleDb.OleDbType.VarWChar, 50,
System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0,
Byte), "Route", System.Data.DataRowVersion.Original, Nothing))
'
------=_NextPart_000_0000_01C4DC3C.8D141AB0
Content-Type: text/html;
charset="us-ascii"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Dus-ascii">
<META content=3D"MSHTML 6.00.2900.2523" name=3DGENERATOR></HEAD>
<BODY>
<DIV><FONT face=3DArial size=3D2><SPAN=20
class=3D486520223-06122004>Hi,</SPAN></FONT></DIV>
<DIV><FONT face=3DArial size=3D2><SPAN=20
class=3D486520223-06122004></SPAN></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2><SPAN class=3D486520223-06122004>I am =
using access as=20
the main DB for an application.</SPAN></FONT></DIV>
<DIV><FONT face=3DArial size=3D2><SPAN=20
class=3D486520223-06122004></SPAN></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2><SPAN =
class=3D486520223-06122004>Whenever I try to=20
update the DB by my Dataset I get Exception below.</SPAN></FONT></DIV>
<DIV><FONT face=3DArial size=3D2><SPAN=20
class=3D486520223-06122004></SPAN></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2><SPAN=20
class=3D486520223-06122004>--------------</SPAN></FONT></DIV>
<DIV><FONT face=3DArial size=3D2><SPAN class=3D486520223-06122004>An =
unhandled=20
exception of type 'System.Data.DBConcurrencyException' occurred in=20
system.data.dll</SPAN></FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=3DArial size=3D2><SPAN =
class=3D486520223-06122004>Additional=20
information: Concurrency violation: the DeleteCommand affected 0=20
records.</SPAN></FONT></DIV>
<DIV><FONT face=3DArial size=3D2><SPAN=20
class=3D486520223-06122004>--------------</SPAN></FONT></DIV>
<DIV><FONT face=3DArial size=3D2><SPAN=20
class=3D486520223-06122004></SPAN></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2><SPAN class=3D486520223-06122004>What =
worries me is=20
the "?" in the SQL below of the Update Command? Is this=20
normal?</SPAN></FONT></DIV>
<DIV><FONT face=3DArial size=3D2><SPAN class=3D486520223-06122004>I just =
cannot get my=20
head around the "?"</SPAN></FONT></DIV>
<DIV><FONT face=3DArial size=3D2><SPAN=20
class=3D486520223-06122004></SPAN></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2><SPAN class=3D486520223-06122004>All =
the code below=20
was generated by Visual Studio.</SPAN></FONT></DIV>
<DIV><FONT face=3DArial size=3D2><SPAN=20
class=3D486520223-06122004></SPAN></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2><SPAN class=3D486520223-06122004>Do I =
have to modify=20
this or am I doing something Wrong?</SPAN></FONT></DIV>
<DIV><FONT face=3DArial size=3D2><SPAN=20
class=3D486520223-06122004></SPAN></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2><SPAN class=3D486520223-06122004>Thanks =
in=20
Advance.</SPAN></FONT></DIV>
<DIV><FONT face=3DArial size=3D2><SPAN=20
class=3D486520223-06122004></SPAN></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2><SPAN class=3D486520223-06122004><FONT =
color=3D#008000=20
size=3D2> </DIV>
<DIV></FONT><FONT size=3D2>
<P></FONT><FONT color=3D#008000 =
size=3D2>'OleDbUpdateCommand1</P></FONT><FONT=20
size=3D2>
<P></FONT><FONT color=3D#008000 size=3D2>'</P></FONT><FONT size=3D2>
<P></FONT><FONT color=3D#0000ff size=3D2>Me</FONT><FONT=20
size=3D2>.OleDbUpdateCommand1.CommandText =3D "UPDATE Reminders SET =
ReminderDate =3D=20
?, ReminderTime =3D ?, Route =3D ? WHERE (EventID" & _</P>
<P>" =3D ?) AND (ReminderDate =3D ? OR ? IS NULL AND ReminderDate IS =
NULL) AND=20
(Reminder" & _</P>
<P>"Time =3D ? OR ? IS NULL AND ReminderTime IS NULL) AND (Route =3D ? =
OR ? IS NULL=20
AND " & _</P>
<P>"Route IS NULL)"</P>
<P></FONT><FONT color=3D#0000ff size=3D2>Me</FONT><FONT=20
size=3D2>.OleDbUpdateCommand1.Connection =3D </FONT><FONT =
color=3D#0000ff=20
size=3D2>Me</FONT><FONT size=3D2>.OleDbConnection</P>
<P></FONT><FONT color=3D#0000ff size=3D2>Me</FONT><FONT=20
size=3D2>.OleDbUpdateCommand1.Parameters.Add(</FONT><FONT =
color=3D#0000ff=20
size=3D2>New</FONT><FONT size=3D2> =
System.Data.OleDb.OleDbParameter("ReminderDate",=20
System.Data.OleDb.OleDbType.DBDate, 0, "ReminderDate"))</P>
<P></FONT><FONT color=3D#0000ff size=3D2>Me</FONT><FONT=20
size=3D2>.OleDbUpdateCommand1.Parameters.Add(</FONT><FONT =
color=3D#0000ff=20
size=3D2>New</FONT><FONT size=3D2> =
System.Data.OleDb.OleDbParameter("ReminderTime",=20
System.Data.OleDb.OleDbType.DBDate, 0, "ReminderTime"))</P>
<P></FONT><FONT color=3D#0000ff size=3D2>Me</FONT><FONT=20
size=3D2>.OleDbUpdateCommand1.Parameters.Add(</FONT><FONT =
color=3D#0000ff=20
size=3D2>New</FONT><FONT size=3D2> =
System.Data.OleDb.OleDbParameter("Route",=20
System.Data.OleDb.OleDbType.VarWChar, 50, "Route"))</P>
<P></FONT><FONT color=3D#0000ff size=3D2>Me</FONT><FONT=20
size=3D2>.OleDbUpdateCommand1.Parameters.Add(</FONT><FONT =
color=3D#0000ff=20
size=3D2>New</FONT><FONT size=3D2>=20
System.Data.OleDb.OleDbParameter("Original_EventID",=20
System.Data.OleDb.OleDbType.Integer, 0, =
System.Data.ParameterDirection.Input,=20
</FONT><FONT color=3D#0000ff size=3D2>False</FONT><FONT size=3D2>, =
</FONT><FONT=20
color=3D#0000ff size=3D2>CType</FONT><FONT size=3D2>(0, </FONT><FONT =
color=3D#0000ff=20
size=3D2>Byte</FONT><FONT size=3D2>), </FONT><FONT color=3D#0000ff=20
size=3D2>CType</FONT><FONT size=3D2>(0, </FONT><FONT color=3D#0000ff=20
size=3D2>Byte</FONT><FONT size=3D2>), "EventID",=20
System.Data.DataRowVersion.Original, </FONT><FONT color=3D#0000ff=20
size=3D2>Nothing</FONT><FONT size=3D2>))</P>
<P></FONT><FONT color=3D#0000ff size=3D2>Me</FONT><FONT=20
size=3D2>.OleDbUpdateCommand1.Parameters.Add(</FONT><FONT =
color=3D#0000ff=20
size=3D2>New</FONT><FONT size=3D2>=20
System.Data.OleDb.OleDbParameter("Original_ReminderDate",=20
System.Data.OleDb.OleDbType.DBDate, 0, =
System.Data.ParameterDirection.Input,=20
</FONT><FONT color=3D#0000ff size=3D2>False</FONT><FONT size=3D2>, =
</FONT><FONT=20
color=3D#0000ff size=3D2>CType</FONT><FONT size=3D2>(0, </FONT><FONT =
color=3D#0000ff=20
size=3D2>Byte</FONT><FONT size=3D2>), </FONT><FONT color=3D#0000ff=20
size=3D2>CType</FONT><FONT size=3D2>(0, </FONT><FONT color=3D#0000ff=20
size=3D2>Byte</FONT><FONT size=3D2>), "ReminderDate",=20
System.Data.DataRowVersion.Original, </FONT><FONT color=3D#0000ff=20
size=3D2>Nothing</FONT><FONT size=3D2>))</P>
<P></FONT><FONT color=3D#0000ff size=3D2>Me</FONT><FONT=20
size=3D2>.OleDbUpdateCommand1.Parameters.Add(</FONT><FONT =
color=3D#0000ff=20
size=3D2>New</FONT><FONT size=3D2>=20
System.Data.OleDb.OleDbParameter("Original_ReminderDate1",=20
System.Data.OleDb.OleDbType.DBDate, 0, =
System.Data.ParameterDirection.Input,=20
</FONT><FONT color=3D#0000ff size=3D2>False</FONT><FONT size=3D2>, =
</FONT><FONT=20
color=3D#0000ff size=3D2>CType</FONT><FONT size=3D2>(0, </FONT><FONT =
color=3D#0000ff=20
size=3D2>Byte</FONT><FONT size=3D2>), </FONT><FONT color=3D#0000ff=20
size=3D2>CType</FONT><FONT size=3D2>(0, </FONT><FONT color=3D#0000ff=20
size=3D2>Byte</FONT><FONT size=3D2>), "ReminderDate",=20
System.Data.DataRowVersion.Original, </FONT><FONT color=3D#0000ff=20
size=3D2>Nothing</FONT><FONT size=3D2>))</P>
<P></FONT><FONT color=3D#0000ff size=3D2>Me</FONT><FONT=20
size=3D2>.OleDbUpdateCommand1.Parameters.Add(</FONT><FONT =
color=3D#0000ff=20
size=3D2>New</FONT><FONT size=3D2>=20
System.Data.OleDb.OleDbParameter("Original_ReminderTime",=20
System.Data.OleDb.OleDbType.DBDate, 0, =
System.Data.ParameterDirection.Input,=20
</FONT><FONT color=3D#0000ff size=3D2>False</FONT><FONT size=3D2>, =
</FONT><FONT=20
color=3D#0000ff size=3D2>CType</FONT><FONT size=3D2>(0, </FONT><FONT =
color=3D#0000ff=20
size=3D2>Byte</FONT><FONT size=3D2>), </FONT><FONT color=3D#0000ff=20
size=3D2>CType</FONT><FONT size=3D2>(0, </FONT><FONT color=3D#0000ff=20
size=3D2>Byte</FONT><FONT size=3D2>), "ReminderTime",=20
System.Data.DataRowVersion.Original, </FONT><FONT color=3D#0000ff=20
size=3D2>Nothing</FONT><FONT size=3D2>))</P>
<P></FONT><FONT color=3D#0000ff size=3D2>Me</FONT><FONT=20
size=3D2>.OleDbUpdateCommand1.Parameters.Add(</FONT><FONT =
color=3D#0000ff=20
size=3D2>New</FONT><FONT size=3D2>=20
System.Data.OleDb.OleDbParameter("Original_ReminderTime1",=20
System.Data.OleDb.OleDbType.DBDate, 0, =
System.Data.ParameterDirection.Input,=20
</FONT><FONT color=3D#0000ff size=3D2>False</FONT><FONT size=3D2>, =
</FONT><FONT=20
color=3D#0000ff size=3D2>CType</FONT><FONT size=3D2>(0, </FONT><FONT =
color=3D#0000ff=20
size=3D2>Byte</FONT><FONT size=3D2>), </FONT><FONT color=3D#0000ff=20
size=3D2>CType</FONT><FONT size=3D2>(0, </FONT><FONT color=3D#0000ff=20
size=3D2>Byte</FONT><FONT size=3D2>), "ReminderTime",=20
System.Data.DataRowVersion.Original, </FONT><FONT color=3D#0000ff=20
size=3D2>Nothing</FONT><FONT size=3D2>))</P>
<P></FONT><FONT color=3D#0000ff size=3D2>Me</FONT><FONT=20
size=3D2>.OleDbUpdateCommand1.Parameters.Add(</FONT><FONT =
color=3D#0000ff=20
size=3D2>New</FONT><FONT size=3D2>=20
System.Data.OleDb.OleDbParameter("Original_Route",=20
System.Data.OleDb.OleDbType.VarWChar, 50, =
System.Data.ParameterDirection.Input,=20
</FONT><FONT color=3D#0000ff size=3D2>False</FONT><FONT size=3D2>, =
</FONT><FONT=20
color=3D#0000ff size=3D2>CType</FONT><FONT size=3D2>(0, </FONT><FONT =
color=3D#0000ff=20
size=3D2>Byte</FONT><FONT size=3D2>), </FONT><FONT color=3D#0000ff=20
size=3D2>CType</FONT><FONT size=3D2>(0, </FONT><FONT color=3D#0000ff=20
size=3D2>Byte</FONT><FONT size=3D2>), "Route", =
System.Data.DataRowVersion.Original,=20
</FONT><FONT color=3D#0000ff size=3D2>Nothing</FONT><FONT =
size=3D2>))</P>
<P></FONT><FONT color=3D#0000ff size=3D2>Me</FONT><FONT=20
size=3D2>.OleDbUpdateCommand1.Parameters.Add(</FONT><FONT =
color=3D#0000ff=20
size=3D2>New</FONT><FONT size=3D2>=20
System.Data.OleDb.OleDbParameter("Original_Route1",=20
System.Data.OleDb.OleDbType.VarWChar, 50, =
System.Data.ParameterDirection.Input,=20
</FONT><FONT color=3D#0000ff size=3D2>False</FONT><FONT size=3D2>, =
</FONT><FONT=20
color=3D#0000ff size=3D2>CType</FONT><FONT size=3D2>(0, </FONT><FONT =
color=3D#0000ff=20
size=3D2>Byte</FONT><FONT size=3D2>), </FONT><FONT color=3D#0000ff=20
size=3D2>CType</FONT><FONT size=3D2>(0, </FONT><FONT color=3D#0000ff=20
size=3D2>Byte</FONT><FONT size=3D2>), "Route", =
System.Data.DataRowVersion.Original,=20
</FONT><FONT color=3D#0000ff size=3D2>Nothing</FONT><FONT =
size=3D2>))</P>
<P></FONT><FONT color=3D#008000=20
size=3D2>'</P></FONT></SPAN></FONT></DIV></BODY></HTML>
------=_NextPart_000_0000_01C4DC3C.8D141AB0--