PC Review


Reply
Thread Tools Rate Thread

A first chance exception of type 'System.Data.OleDb.OleDbException' occurred in System.Data.dll

 
 
sirinath
Guest
Posts: n/a
 
      8th Oct 2007
Hi,

I am getting this exception when I am trying to insert the second item
to an access DB. The values are from another OleDB source.

If there are links about this exception please let me know.

The full exception:

A first chance exception of type 'System.Data.OleDb.OleDbException'
occurred in System.Data.dll
System.Data.OleDb.OleDbException: The changes you requested to the
table were not successful because they would create duplicate values
in the index, primary key, or relationship. Change the data in the
field or fields that contain duplicate data, remove the index, or
redefine the index to permit duplicate entries and try again.
at
System.Data.OleDb.OleDbCommand.ExecuteCommandTextForSingleResult(tagDBPARAMS
dbParams, Object& executeResult)
at System.Data.OleDb.OleDbCommand.ExecuteCommandText(Object&
executeResult)
at System.Data.OleDb.OleDbCommand.ExecuteCommand(CommandBehavior
behavior, Object& executeResult)
at
System.Data.OleDb.OleDbCommand.ExecuteReaderInternal(CommandBehavior
behavior, String method)
at System.Data.OleDb.OleDbCommand.ExecuteNonQuery()
at
PairTraderWindowsApplication.ConfigForm.importCompany(OleDbConnection
conDB, OleDbConnection conImportExcel, String sectorName) in C:
\Documents and Settings\sumindad\My Documents\Visual Studio
2005\Projects\PairTraderWindowsApplication\PairTraderWindowsApplication
\Config.cs:line 226
at PairTraderWindowsApplication.ConfigForm.doImport(Object
dummyObj) in C:\Documents and Settings\sumindad\My Documents\Visual
Studio 2005\Projects\PairTraderWindowsApplication
\PairTraderWindowsApplication\Config.cs:line 132

Best regards, Suminda Sirinath Salpitikorala Dharmasena

 
Reply With Quote
 
 
 
 
sirinath
Guest
Posts: n/a
 
      8th Oct 2007
Hi,

NB: The PK is an auto number and there are no indexes in the given
table. This fail in the insert of the second item which is different
from the 1st.

Best regards, Suminda Sirinath Salpitikorala Dharmasena

On Oct 8, 8:45 pm, sirinath <sirinath19...@gmail.com> wrote:
> Hi,
>
> I am getting this exception when I am trying to insert the second item
> to an access DB. The values are from another OleDB source.
>
> If there are links about this exception please let me know.
>
> The full exception:
>
> A first chance exception of type 'System.Data.OleDb.OleDbException'
> occurred in System.Data.dll
> System.Data.OleDb.OleDbException: The changes you requested to the
> table were not successful because they would create duplicate values
> in the index, primary key, or relationship. Change the data in the
> field or fields that contain duplicate data, remove the index, or
> redefine the index to permit duplicate entries and try again.
> at
> System.Data.OleDb.OleDbCommand.ExecuteCommandTextForSingleResult(tagDBPARAM*S
> dbParams, Object& executeResult)
> at System.Data.OleDb.OleDbCommand.ExecuteCommandText(Object&
> executeResult)
> at System.Data.OleDb.OleDbCommand.ExecuteCommand(CommandBehavior
> behavior, Object& executeResult)
> at
> System.Data.OleDb.OleDbCommand.ExecuteReaderInternal(CommandBehavior
> behavior, String method)
> at System.Data.OleDb.OleDbCommand.ExecuteNonQuery()
> at
> PairTraderWindowsApplication.ConfigForm.importCompany(OleDbConnection
> conDB, OleDbConnection conImportExcel, String sectorName) in C:
> \Documents and Settings\sumindad\My Documents\Visual Studio
> 2005\Projects\PairTraderWindowsApplication\PairTraderWindowsApplication
> \Config.cs:line 226
> at PairTraderWindowsApplication.ConfigForm.doImport(Object
> dummyObj) in C:\Documents and Settings\sumindad\My Documents\Visual
> Studio 2005\Projects\PairTraderWindowsApplication
> \PairTraderWindowsApplication\Config.cs:line 132
>
> Best regards, Suminda Sirinath Salpitikorala Dharmasena



 
Reply With Quote
 
 
 
 
Chris Alton [MSFT]
Guest
Posts: n/a
 
      8th Oct 2007
Please post the two rows of data you are inserting and the section of code
you are using to do the inserts.
-------------------------------------
Chris Alton, Microsoft Corp.
SQL Server Developer Support Engineer
This posting is provided "AS IS" with no warranties, and confers no rights.
--------------------
> From: sirinath <(E-Mail Removed)>
> Newsgroups:

microsoft.public.data.oledb,microsoft.public.data.ado,microsoft.public.dotne
t.languages.csharp,microsoft.public.dotnet.framework.adonet,microsoft.public
..access
> Subject: Re: A first chance exception of type

'System.Data.OleDb.OleDbException' occurred in System.Data.dll
> Date: Mon, 08 Oct 2007 16:25:05 -0000
>
> Hi,
> NB: The PK is an auto number and there are no indexes in the given
> table. This fail in the insert of the second item which is different
> from the 1st.
> Best regards, Suminda Sirinath Salpitikorala Dharmasena
> On Oct 8, 8:45 pm, sirinath <sirinath19...@gmail.com> wrote:
> > Hi,
> >
> > I am getting this exception when I am trying to insert the second item
> > to an access DB. The values are from another OleDB source.
> >
> > If there are links about this exception please let me know.
> >
> > The full exception:
> >
> > A first chance exception of type 'System.Data.OleDb.OleDbException'
> > occurred in System.Data.dll
> > System.Data.OleDb.OleDbException: The changes you requested to the
> > table were not successful because they would create duplicate values
> > in the index, primary key, or relationship. Change the data in the
> > field or fields that contain duplicate data, remove the index, or
> > redefine the index to permit duplicate entries and try again.
> > at
> >

System.Data.OleDb.OleDbCommand.ExecuteCommandTextForSingleResult(tagDBPARAM*
S
> > dbParams, Object& executeResult)
> > at System.Data.OleDb.OleDbCommand.ExecuteCommandText(Object&
> > executeResult)
> > at System.Data.OleDb.OleDbCommand.ExecuteCommand(CommandBehavior
> > behavior, Object& executeResult)
> > at
> > System.Data.OleDb.OleDbCommand.ExecuteReaderInternal(CommandBehavior
> > behavior, String method)
> > at System.Data.OleDb.OleDbCommand.ExecuteNonQuery()
> > at
> > PairTraderWindowsApplication.ConfigForm.importCompany(OleDbConnection
> > conDB, OleDbConnection conImportExcel, String sectorName) in C:
> > \Documents and Settings\sumindad\My Documents\Visual Studio
> > 2005\Projects\PairTraderWindowsApplication\PairTraderWindowsApplication
> > \Config.cs:line 226
> > at PairTraderWindowsApplication.ConfigForm.doImport(Object
> > dummyObj) in C:\Documents and Settings\sumindad\My Documents\Visual
> > Studio 2005\Projects\PairTraderWindowsApplication
> > \PairTraderWindowsApplication\Config.cs:line 132
> >
> > Best regards, Suminda Sirinath Salpitikorala Dharmasena

>


 
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
How do I track down this error??? A first chance exception of type 'System.Runtime.InteropServices.COMException' occurred in xxx.exe Hexman Microsoft VB .NET 0 19th Aug 2006 08:33 AM
A first chance exception of type 'System.ArgumentOutOfRangeException' occurred in mscorlib.dll Pieter Microsoft Dot NET Framework 3 24th Nov 2005 02:11 PM
A first chance exception of type 'System.ArgumentOutOfRangeException' occurred in mscorlib.dll Pieter Microsoft C# .NET 3 24th Nov 2005 02:11 PM
first chance exception of type 'System.Data.SqlClient.SqlException' occurred in system.data.dll gv Microsoft ADO .NET 0 31st Mar 2005 09:11 PM
A first chance exception of type 'System.InvalidCastException' occurred in scs.sr.dal.dll karunakar Microsoft C# .NET 3 4th Feb 2005 04:54 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 04:31 PM.