I'm studing this don't know what to do yet, creates duplicate key??
Steve
Message1 ---
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.
String Message ---
System.Data.Ole Db.OleDbExcepti on: 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.Com mon.DbDataAdapt er.Update(DataR ow[] dataRows,
DataTableMappin g tableMapping)
at System.Data.Com mon.DbDataAdapt er.Update(DataS et dataSet, String
srcTable)
at businessInforma tion.ConfigMgmt Log.UpdateDataB ase() in
c:\businessinfo rmationsoftware \businessinform ation\configmgm tlog.cs:line 2028
HelpLink ---
Source ---
Microsoft JET Database Engine
StackTrace ---
at System.Data.Com mon.DbDataAdapt er.Update(DataR ow[] dataRows,
DataTableMappin g tableMapping)
at System.Data.Com mon.DbDataAdapt er.Update(DataS et dataSet, String
srcTable)
at businessInforma tion.ConfigMgmt Log.UpdateDataB ase() in
c:\businessinfo rmationsoftware \businessinform ation\configmgm tlog.cs:line 2028
TargetSite ---
Int32 Update(System.D ata.DataRow[], System.Data.Com mon.DataTableMa pping)
Inner Exception ---
The program '[1992] businessInforma tion.exe' has exited with code 0 (0x0).
"LEBRUN Thomas" wrote:
It's a System.Data.Ole Db.OleDbExcepti on.
Ok, but you need to catch nd display the complete error of th exception ;)
Bye
-------------------
LEBRUN Thomas
http://morpheus.developpez.com
http://blog.developpez.com/index.php?blog=9
"Steve B." wrote:
It's a System.Data.Ole Db.OleDbExcepti on.
Looks like the database. Wouldn't the Open() fail if it was a problem with
the dB?
Should I recreate the Conn, DA and DS
Steve
"Steve B." wrote:
Does anyone know why the DA Update() would throw an exception?
I moved the database but I updated the Conn and the DA, currently
(trying)removin g/replacing DS. Is there a another direction I should be
looking in? Does it matter if I move columns in the grid (everything is a
string anyways)? Does the DS need to be udated from the DT?
***************
int rowNo = dg.CurrentRowIn dex;
dt = dt .Rows[rowNo].BeginEdit();
dt = dt .Rows[rowNo][columnName] = strgCellFill;
dt = dt .Rows[rowNo].EndEdit();
string s = dt.Rows[rowNo][columnName]; // s = strgCellFill
DataRow dr = dt.Rows[rowNo];
string s1 = dr.RowState.ToS tring(); // s1 = "Modified"
DS dataSetChanges = getDataSetChang es();
if (dataSetChanges .HasChanges())
{
this.Conn.Open( );
this.da.Update( ds); //throws an exception
this.Conn.Close ();
}