Skip to main content

Posts

Axapta Code to Import from Excel To Table.

Axapta Code to Import from Excel To Table. void importFromExcel() { myTable myTable; COMVariant COMVariant1; SysExcelApplication app; SysExcelWorkbooks Workbooks; SysExcelWorkbook Workbook; SysExcelWorksheets Worksheets; SysExcelWorksheet Worksheet; SysExcelCells Cells; SysExcelCell RCell; int i; #excel app = SysExcelApplication::construct(); Workbooks = app.Workbooks(); COMVariant1 = new COMVariant(); COMVariant1.bStr("C:\\myExcel.xls"); Workbook = Workbooks.Add(COMVariant1); Worksheets = Workbook.worksheets(); Worksheet = Worksheets.itemFromName("myTable"); Cells = Worksheet.Cells(); i = 2; RCell = Cells.Item(i, 1); ttsbegin; while(RCell.Value().bStr() != '') { myTable.Field1Id = RCell.value().bStr(); RCell = Cells.Item(i, 2); myTable.Field2 = RCell.value().bStr(); RCell = Cells.Item(i, 3); myTable.FieldInt = str2int(RCell.value().toString()); RCell = Cells.It...

Test Your .NET Knowledge

Q1. “Crushader” company wants to revamp his website. One of the important changes “Crushader” want is to display Ad banners. As a developer, you want to initialize the banner image paths when the first user accesses the application. So what will you do? 1. Add code in application_onstart event of global. Sax file. 2. Add code in application begin request event of global. Sax file. 3. Add code to session_onstart event of global. Sax. 4. Add code in page. Load event handler in the startup page of the application. 5. Create a user control named “Banner.ascx” and initialize all the image paths in this ascx. Then include this banner.ascx in all the pages of the application, which needs the banner displays. Answer 1. Q2 Which one of the following is a limitation of XML serialization? A. In classes that implement IEnumerable, the collection is not serialized. B. You cannot serialize an object's public fields. C. You cannot serialize Dataset objects. D. You cannot serialize Xm...