Oct 7, 2011

OracleBulkCopy Class

Using OracleBulkCopy Class you can Insert Bulk Data from your application to your table.

Oracle bulk copy  is class which provided by Oracle. to use this class you have to add the refrence of Oracle.DataAccess.dll . You can easily find this dll in your Oracle app Folder ( \app\eyespot\product\11.2.0\client_1\ODP.NET\bin\2.x\Oracle.DataAccess.dll).
After adding the refrence of dll you nedd to use Oracle.DataAccess.Client;

using Oracle.DataAccess.Client;
// Remember you need a object of OracleConnection

OracleConnection con = new OracleConnection(Your connection string);
con.Open();
OracleBulkCopy oraBulkCopy = new OracleBulkCopy(con);
oraBulkCopy.DestinationTableName = "your destination table name";
oraBulkCopy.WriteToServer(table);

For More Details:-http://download.oracle.com/docs/html/E10927_01/OracleBulkCopyClass.htm#BIHBJCHG

No comments: