本文整理匯總了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);
}
示例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
}
示例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);
}