Hi Julian,
Oracle adapter should be configured for inserting, not for selecting, in
your case.
You might want to create a connection to oracle database in server explorer
and drag&drop the table (which is in oracle's database) from server explorer
onto the form.
The wizard will generate the code for you - see Windows Froms Designer
generated code region.
Then you should use oraDa.Update(accTbl) to insert rows into oracle (don't
forget to open the oraConn before.
--
Miha Markic [MVP C#] - RightHand .NET consulting & software development
miha at rthand com
www.rthand.com
Julian said:
Hi Miha,
This is the code snippet.Access table is the source and Oracle table is
the destination.Both have got identical tables.(fields,field types etc).
One of the access field is an autonumber which is the primary key of the table.
OleDbDataAdapter accDa = new OleDbDataAdapter("select * from accessTable",accConn);
OleDbDataAdapter oraDa = new OleDbDataAdapter("select * from oracleTable",oraConn);
accDa.AcceptChangesDuringFill = false;
DataTable accTbl = new DataTable();
accDa.Fill(accTbl);
oraDa.Fill(accTbl);
Error is
Exception Details: System.Data.OleDb.OleDbException: Unspecified error
Oracle error occurred, but error message could not be retrieved from Oracle.
Data type is not supported.
Source Error:
Line 38: oraDa.Fill(accTbl); ------- This is given in red
Stack Trace:
[OleDbException (0x80004005): Unspecified error
Oracle error occurred, but error message could not be retrieved from Oracle.
Data type is not supported.]
System.Data.OleDb.OleDbCommand.ExecuteCommandTextErrorHandling(Int32 hr) +41
System.Data.OleDb.OleDbCommand.ExecuteCommandTextForSingleResult(tagDBPARAMS
dbParams, Object& executeResult) +174
System.Data.OleDb.OleDbCommand.ExecuteCommandText(Object& executeResult) +92
System.Data.OleDb.OleDbCommand.ExecuteCommand(CommandBehavior behavior, Object& executeResult) +65
System.Data.OleDb.OleDbCommand.ExecuteReaderInternal(CommandBehavior behavior, String method) +112
System.Data.OleDb.OleDbCommand.ExecuteReader(CommandBehavior behavior) +68
System.Data.OleDb.OleDbCommand.System.Data.IDbCommand.ExecuteReader(CommandB
ehavior behavior) +5
System.Data.Common.DbDataAdapter.FillFromCommand(Object data, Int32
startRecord, Int32 maxRecords, String srcTable, IDbCommand command,
CommandBehavior behavior) +304
System.Data.Common.DbDataAdapter.Fill(DataTable dataTable, IDbCommand
command, CommandBehavior behavior)