PC Review


Reply
Thread Tools Rate Thread

DBConcurrencyException when using OleDBTypes DBDate and Double

 
 
G@z
Guest
Posts: n/a
 
      22nd Feb 2005
I'm a total newbie at this - but I am currently writing a vb.net winforms
application which utilises an MS Access database.

When trying to delete rows in my datagrid and post the changes back to the
database, I keep receiving a DBConcurrencyException informing me that no
rows have been deleted.

Through trial and error, I have found that the exception is arises when the
oledbtype of a column is set to "dbdate" or "double". For the time being,
I've worked around the dbdate problem by setting the type to "date". But I
can't seem to find a workaround for the "double" type problem - setting the
type to integer, single and decimal has not helped (even though one of the
other columns in my database has its type set to integer and seems to work).

I have three questions:

1. Has anyone else experienced the same problems?;
2. Is it okay to change the dbdate type to date? (the column is supposed to
record dates in the form of dd/mm/yyyy); and
3. Does anyone have a workaround for the "double" problem or is this a bug
in .net/access?

The following is a copy of my original deletecommand and its parameters
(without the changes to the dbdate types):

'OleDbDeleteCommand1
'
Me.OleDbDeleteCommand1.CommandText = "DELETE FROM TSData2 WHERE
(EntryID = ?) AND (Billed = ?) AND (File = ? OR ? IS NU" & _
"LL AND File IS NULL) AND (Finish = ? OR ? IS NULL AND Finish IS
NULL) AND (Start" & _
" = ? OR ? IS NULL AND Start IS NULL) AND (Summary = ? OR ? IS NULL
AND Summary I" & _
"S NULL) AND ([Time] = ? OR ? IS NULL AND [Time] IS NULL) AND
(TimesheetID = ? OR" & _
" ? IS NULL AND TimesheetID IS NULL) AND (Units = ?)"
Me.OleDbDeleteCommand1.Connection = Me.OleDbConnection1
Me.OleDbDeleteCommand1.Parameters.Add(New
System.Data.OleDb.OleDbParameter("Original_EntryID",
System.Data.OleDb.OleDbType.Integer, 0,
System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0, Byte),
"EntryID", System.Data.DataRowVersion.Original, Nothing))
Me.OleDbDeleteCommand1.Parameters.Add(New
System.Data.OleDb.OleDbParameter("Original_Billed",
System.Data.OleDb.OleDbType.Boolean, 2,
System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0, Byte),
"Billed", System.Data.DataRowVersion.Original, Nothing))
Me.OleDbDeleteCommand1.Parameters.Add(New
System.Data.OleDb.OleDbParameter("Original_File",
System.Data.OleDb.OleDbType.VarWChar, 50,
System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0, Byte),
"File", System.Data.DataRowVersion.Original, Nothing))
Me.OleDbDeleteCommand1.Parameters.Add(New
System.Data.OleDb.OleDbParameter("Original_File1",
System.Data.OleDb.OleDbType.VarWChar, 50,
System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0, Byte),
"File", System.Data.DataRowVersion.Original, Nothing))
Me.OleDbDeleteCommand1.Parameters.Add(New
System.Data.OleDb.OleDbParameter("Original_Finish",
System.Data.OleDb.OleDbType.DBDate, 0, System.Data.ParameterDirection.Input,
False, CType(0, Byte), CType(0, Byte), "Finish",
System.Data.DataRowVersion.Original, Nothing))
Me.OleDbDeleteCommand1.Parameters.Add(New
System.Data.OleDb.OleDbParameter("Original_Finish1",
System.Data.OleDb.OleDbType.DBDate, 0, System.Data.ParameterDirection.Input,
False, CType(0, Byte), CType(0, Byte), "Finish",
System.Data.DataRowVersion.Original, Nothing))
Me.OleDbDeleteCommand1.Parameters.Add(New
System.Data.OleDb.OleDbParameter("Original_Start",
System.Data.OleDb.OleDbType.DBDate, 0, System.Data.ParameterDirection.Input,
False, CType(0, Byte), CType(0, Byte), "Start",
System.Data.DataRowVersion.Original, Nothing))
Me.OleDbDeleteCommand1.Parameters.Add(New
System.Data.OleDb.OleDbParameter("Original_Start1",
System.Data.OleDb.OleDbType.DBDate, 0, System.Data.ParameterDirection.Input,
False, CType(0, Byte), CType(0, Byte), "Start",
System.Data.DataRowVersion.Original, Nothing))
Me.OleDbDeleteCommand1.Parameters.Add(New
System.Data.OleDb.OleDbParameter("Original_Summary",
System.Data.OleDb.OleDbType.VarWChar, 255,
System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0, Byte),
"Summary", System.Data.DataRowVersion.Original, Nothing))
Me.OleDbDeleteCommand1.Parameters.Add(New
System.Data.OleDb.OleDbParameter("Original_Summary1",
System.Data.OleDb.OleDbType.VarWChar, 255,
System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0, Byte),
"Summary", System.Data.DataRowVersion.Original, Nothing))
Me.OleDbDeleteCommand1.Parameters.Add(New
System.Data.OleDb.OleDbParameter("Original_Time",
System.Data.OleDb.OleDbType.DBDate, 0, System.Data.ParameterDirection.Input,
False, CType(0, Byte), CType(0, Byte), "Time",
System.Data.DataRowVersion.Original, Nothing))
Me.OleDbDeleteCommand1.Parameters.Add(New
System.Data.OleDb.OleDbParameter("Original_Time1",
System.Data.OleDb.OleDbType.DBDate, 0, System.Data.ParameterDirection.Input,
False, CType(0, Byte), CType(0, Byte), "Time",
System.Data.DataRowVersion.Original, Nothing))
Me.OleDbDeleteCommand1.Parameters.Add(New
System.Data.OleDb.OleDbParameter("Original_TimesheetID",
System.Data.OleDb.OleDbType.Integer, 0,
System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0, Byte),
"TimesheetID", System.Data.DataRowVersion.Original, Nothing))
Me.OleDbDeleteCommand1.Parameters.Add(New
System.Data.OleDb.OleDbParameter("Original_TimesheetID1",
System.Data.OleDb.OleDbType.Integer, 0,
System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0, Byte),
"TimesheetID", System.Data.DataRowVersion.Original, Nothing))
Me.OleDbDeleteCommand1.Parameters.Add(New
System.Data.OleDb.OleDbParameter("Original_Units",
System.Data.OleDb.OleDbType.Double, 0, System.Data.ParameterDirection.Input,
False, CType(0, Byte), CType(0, Byte), "Units",
System.Data.DataRowVersion.Original, Nothing))
'

TIA
G@z


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
MS Access Datetime (Short time) -> DBDate nb Microsoft Dot NET 1 21st Mar 2006 08:30 PM
DBConcurrencyException when using OleDBTypes DBDate and Double G@z Microsoft ADO .NET 1 1st Mar 2005 11:28 PM
OleDbTypes (Decimal vs Double) and Oracle binding parameters. =?ISO-8859-1?Q?Atli_Bj=F6rgvin_Oddsson?= Microsoft ADO .NET 0 2nd Sep 2004 05:46 PM
System.types->OleDbTypes Konrad Microsoft ADO .NET 3 22nd Sep 2003 05:28 AM
BUG?: DACW generates DBDate parameters instead of DBTimestamp for oledb DA. François Rioux Microsoft ADO .NET 1 29th Aug 2003 02:29 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 08:58 PM.