Home > Net >  OracleCommandBuilder ConflictOption is not supported
OracleCommandBuilder ConflictOption is not supported

Time:10-08

To:

OracleCommandBuilder. ConflictOption=ConflictOption. OverwriteChanges;
OracleCommandBuilder. Dataadapters=oracleDataAdapter;

Implementation:
OracleDataAdapter. Update (dataTable), automatic Update statement in the where condition, only contains a primary key,

Prompt OracleDataAdapter does not support ConflictOption properties but ORACLE's official documents, so the above statement while compiling passed, but no work,

Consult everybody how to solve?

CodePudding user response:

Back to Microsoft's own version of the ORACLE data, can use, but the ORACLE himself how does not support, roof,

CodePudding user response:

Is this your fall into a pit, and to give up the pit, and see what is the effect of you want? Or are you going to do? Why do you want to do?

CodePudding user response:

reference 1st floor incats response:
return to Microsoft's own version of the ORACLE data, can use, but the ORACLE himself how does not support, roof,

Yes I was connected with the oracle database is the most basic thread pool, and hope can give points

CodePudding user response:

refer to the second floor PaulyJiang response:
what are you fell into a pit, and to give up the pit, and see what is the effect of you want? Or are you going to do? Why do you want to do?


Batch record update status: one from the outside to receive a batch of records, including a field column is the primary key columns in the database, as long as read the key value, go to update the primary key in the status column:

1. Import external records, exists in the DataTable DT1 in
2. Create a DataTable DT2, which in turn read records from the DT1, pseudo code is as follows:
1) datarow=new dt2. Row
2) set the primary key
3) the AcceptChanges
4) set the value of the status bar
5) dt2. Addrow (datarow)
6) dt2. Update
Hope to get the result: the update table set state where primary key column=1=the primary key,
3. Use ORACLE versions of Microsoft libraries to achieve this purpose,

CodePudding user response:

Recommend you only use
OracleCommand CMD=new oracleCommand (text),

CodePudding user response:

The
reference 5 floor XBodhi. Response:
recommend you only use
OracleCommand CMD=new oracleCommand (text),

Positive solution

CodePudding user response:

Oracle's own distinction between 32 and 64 new version does not distinguish between

CodePudding user response:

Public void UpdateStatus (string strColName, int nStatus)
{
String strSql="select * from WonderRecords where 1 & lt;> 1 ";

OracleConnection oc=new OracleConnection (OracleHelper. The ConnectionString);
Oc. The Open ();

OdaAdapter. SelectCommand=new OracleCommand (strSql, oc);
Tables [r]. "WonderRecords PrimaryKey=new DataColumn [] {Tables [r]." WonderRecords "Columns []" recordid "};
OdaAdapter. The Fill (this, "WonderRecords");

OracleCommandBuilder ocb=new OracleCommandBuilder ();

//this is the way, very distress, ODP is not supported, instead of Microsoft is ok, just, still have to mount the ORACLE client on the client,
Ocb. ConflictOption=ConflictOption. OverwriteChanges;

Ocb. Dataadapters=odaAdapter;

int i=0;
Foreach (DataRow Dr In m_wonderData. Tables [r]. "DetailDW" Select (" ", "recordid asc"))
{
DataRow drRecords=Tables [r]. "WonderRecords NewRow ();
"Recordid" drRecords []=m_wonderData. Tables [r]. "DetailDW" Rows [I] [" recordid "];

Tables [r]. "WonderRecords" Rows. The Add (drRecords);

//change the state, to "unchanged"
Tables [r]. "WonderRecords" Rows [I] AcceptChanges ();

The switch (strColName)
{
Case "DDCL" :
DrRecords [" DDCL "]=nStatus;
If (nStatus==1)
{
DrRecords [" PSCLBS "]=m_wonderData. Tables [r]. "DetailDW" Rows [I] [" PSCLBS "];
}

break;
Case "PSDTB" :
"PSDTB" drRecords []=nStatus;
If (nStatus==1)
{
DrRecords [" erpdocid "]=m_wonderData. Tables [r]. "DetailDW" Rows [I] [" erpdocid "];
DrRecords [" erpdtlid "]=m_wonderData. Tables [r]. "DetailDW" Rows [I] [" erpdtlid "];
DrRecords [" PSDBH "]=m_wonderData. Tables [r]. "DetailDW" Rows [I] [" PSDBH "];
DrRecords [" PSMXBH "]=m_wonderData. Tables [r]. "DetailDW" Rows [I] [" PSMXBH "];
DrRecords [" psdate "]=DateTime. Now;
}
break;
Case "FPTB" :
Tables [r]. "WonderRecords" Rows [I] [" FPTB "]=nStatus;
If (nStatus==1)
{
DrRecords [" FPBH "]=m_wonderData. Tables [r]. "DetailDW" Rows [I] [" FPBH "];
DrRecords [" FPMXBH "]=m_wonderData. Tables [r]. "DetailDW" Rows [I] [" FPMXBH "];
DrRecords [" erpfpbh "]=m_wonderData. Tables [r]. "DetailDW" Rows [I] [" erpfpbh "];
DrRecords [" erpfpdm "]=m_wonderData. Tables [r]. "DetailDW" Rows [I] [" erpfpdm "];
DrRecords [" fpdate "]=DateTime. Now;
}
break;
}
}

OdaAdapter. Update (this, "WonderRecords");
//UPDATE above, the generated SQL is my results, similar:
//Update WonderRecords set DDCL=: nStatus, where PSCLBS=XXX recordid=incoming primary key ID;
//Update WonderRecords set PSDTB=: nStatus, erpdocid=XXX, where psdate=XXX recordid=incoming primary key ID;
//Update WonderRecords set FPTB=: nStatus, FPBH=XXX, fpdate=XXX, erpfpbh=XXXX where recordid=incoming primary key ID;
}
  •  Tags:  
  • C#
  • Related