當前位置: 首頁>>代碼示例>>C#>>正文


C# DataTable.ReadFromExcel方法代碼示例

本文整理匯總了C#中System.Data.DataTable.ReadFromExcel方法的典型用法代碼示例。如果您正苦於以下問題:C# DataTable.ReadFromExcel方法的具體用法?C# DataTable.ReadFromExcel怎麽用?C# DataTable.ReadFromExcel使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在System.Data.DataTable的用法示例。


在下文中一共展示了DataTable.ReadFromExcel方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: Demo1

        private static void Demo1()
        {
            //DataTable<GetCurrency> testData = new DataTable<GetCurrency>();
            //testData.GetCopy().ExportToExcel("2.xlsx", "Currency");

            //Thread.Sleep(10000);
            DataTable dt = new DataTable();
            dt.ReadFromExcel("2.xlsx", "Currency");

            DataTable<GetCurrency> data = new DataTable<GetCurrency>(dt);

            //SAPAutoLogon.Logon l = new SAPAutoLogon.Logon();
            //l.StartLogon("LH4_HPI");
            SAPTestHelper.Current.SetSession();

            foreach (GetCurrency curData in data)
            {
                GetCurrency.RunAction(curData);
            }

            //SAPTestHelper.Current.TakeScreenShot(@"\\yanzhou17.asiapacific.hpqcorp.net\Shared Folder\1.jpg");
            //GetCurrency get = new GetCurrency();
            //get.CurFrom = "USD";
            //get.CurTo = "CNY";
            //GetCurrency.RunAction(get);
        }
開發者ID:xneo123,項目名稱:SAPGuiAutomationLib,代碼行數:26,代碼來源:Program.cs

示例2: va01_initial

        public void va01_initial()
        {
            SAPTestHelper.Current.SetSession();
            //Simple workflow
            DataTable dt = new DataTable();
            dt.ReadFromExcel(@"c:\temp\simpleWorkFlow.xlsx", "sheet1");
            DataTable<Program.va01_initial> myTest = new DataTable<Program.va01_initial>(dt);

            foreach (var data in myTest)
            {
                Program.va01_initial.RunAction(data);
            }
            //Simple Workflow
        }
開發者ID:xneo123,項目名稱:CSharpSAPAutomation,代碼行數:14,代碼來源:SimpleWorkflow.cs

示例3: Main

        static void Main(string[] args)
        {
            DataTable dt = new DataTable();
            dt.ReadFromExcel("test.xlsx", "GetCurrency");
            DataTable<GetCurrency> myDatas = new DataTable<GetCurrency>(dt);
            SAPTestHelper.Current.SetSession();
            foreach (var data in myDatas)
            {
                GetCurrency.RunAction(data);
            }

            //var mySAPTable = new SAPBasis();
            //string result = mySAPTable.SAPTable("shell", 1, "From");
            //string result = SAPTestHelper.Current.SAPGuiSession.FindById<GuiMainWindow>("wnd[0]").FindByName<GuiUserArea>("usr").FindByName<GuiCustomControl>("GRID1").FindByName<GuiContainerShell>("shellcont").FindByName<GuiGridView>("shell").GetCellValue(1, "From");
            //string aaa = result;
            //GetCurrency cur = new GetCurrency();
            //cur.RateType = "M";
            //cur.CurFrom = "USD";
            //cur.CurTo = "CNY";
            //GetCurrency.RunAction(cur);
        }
開發者ID:xneo123,項目名稱:SAPAutomationDriver,代碼行數:21,代碼來源:Program.cs


注:本文中的System.Data.DataTable.ReadFromExcel方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。