Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- static void Import_INTO_Table(Args _args)
- {
- CCADOConnection adoConnection;
- CCADOCommand adoCommand;
- CCADORecordSet adoRecordSet;
- CCADOFields adoFields;
- int firstcell;
- ;
- adoConnection = new CCADOConnection();
- adoRecordSet = new CCADORecordSet();
- adoCommand = new CCADOCommand();
- adoConnection.open("Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" + 'D:\ImportData\\Test.xlsx' + ";Extended Properties='Excel 12.0;HDR=No;IMEX=1'"); // for excel 2010
- adoCommand.activeConnection(adoConnection);
- adoCommand.commandText(@"SELECT * FROM [SHEET1$]");
- adoRecordSet = adoCommand.execute();
- while(!adoRecordSet.EOF())
- {
- adoFields = adoRecordSet.fields();
- firstcell = adoFields.itemIdx(0).value();
- adoRecordSet.recordSet().MoveNext();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement