本文整理匯總了C#中System.Data.DataTable.ConvertDataTable方法的典型用法代碼示例。如果您正苦於以下問題:C# DataTable.ConvertDataTable方法的具體用法?C# DataTable.ConvertDataTable怎麽用?C# DataTable.ConvertDataTable使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類System.Data.DataTable
的用法示例。
在下文中一共展示了DataTable.ConvertDataTable方法的9個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: SetExcelRangeData
//public override string[,] SetExcelRangeData(DataTable source)
//{
// string[,] objData = new string[source.Rows.Count, 18];
// for (int i = 0; i < source.Rows.Count; i++)
// {
// System.Data.DataRow dr = source.Rows[i];
// objData[i, 0] = dr["AssetName"].ToString();
// objData[i, 1] = dr["RefNo"].ToString();
// objData[i, 2] = dr["PaperNo"].ToString();
// objData[i, 3] = dr["CardNo"].ToString();
// objData[i, 4] = ((DateTime)dr["StockDate"]).ToString("yyyy-MM-dd");
// objData[i, 5] = dr["OutContractNo"].ToString();
// objData[i, 6] = dr["InCorpName"].ToString();
// objData[i, 7] = dr["OutCorpName"].ToString();
// objData[i, 8] = dr["MUName"].ToString();
// objData[i, 9] = dr["inNetAmount"].ToString();
// objData[i, 10] = dr["ReceiptInGap"].ToString();
// objData[i, 11] = dr["inGapAmount"].ToString();
// objData[i, 12] = dr["inRate"].ToString();
// objData[i, 13] = dr["outNetAmount"].ToString();
// objData[i, 14] = dr["ReceiptOutGap"].ToString();
// objData[i, 15] = dr["outGapAmount"].ToString();
// objData[i, 16] = dr["outRate"].ToString();
// objData[i, 17] = dr["ProfitOrLoss"].ToString();
// }
// return objData;
//}
public override DataTable SetExcelRangeData(DataTable source)
{
string[] strs = new string[] { "AssetName", "RefNo", "PaperNo", "CardNo", "StockDate", "OutContractNo", "InCorpName", "OutCorpName", "MUName", "inNetAmount", "ReceiptInGap", "inGapAmount", "inRate", "outNetAmount", "ReceiptOutGap", "outGapAmount", "outRate", "ProfitOrLoss" };
return source.ConvertDataTable(strs);
}
示例2: SetExcelRangeData
//public override string[,] SetExcelRangeData(DataTable source)
//{
// string[,] objData = new string[source.Rows.Count, 8];
// for (int i = 0; i < source.Rows.Count; i++)
// {
// System.Data.DataRow dr = source.Rows[i];
// objData[i, 0] = ((DateTime)dr["CustomsDate"]).ToString("yyyy-MM-dd");
// objData[i, 1] = dr["RefNo"].ToString();
// objData[i, 2] = dr["GrossWeight"].ToString();
// objData[i, 3] = dr["NetWeight"].ToString();
// objData[i, 4] = dr["MUName"].ToString();
// objData[i, 5] = dr["CorpName"].ToString();
// objData[i, 6] = dr["CurrencyName"].ToString();
// objData[i, 7] = dr["CustomsPrice"].ToString();
// }
// return objData;
//}
public override DataTable SetExcelRangeData(DataTable source)
{
string[] strs = new string[] { "CustomsDate", "RefNo", "GrossWeight", "NetWeight", "MUName", "CorpName", "CurrencyName", "CustomsPrice" };
return source.ConvertDataTable(strs);
}
示例3: SetExcelRangeData
//public override string[,] SetExcelRangeData(DataTable source)
//{
// string[,] objData = new string[source.Rows.Count, 22];
// for (int i = 0; i < source.Rows.Count; i++)
// {
// System.Data.DataRow dr = source.Rows[i];
// objData[i, 0] = ((DateTime)dr["ContractDate"]).ToShortDateString();
// objData[i, 1] = dr["ContractNo"].ToString();
// objData[i, 2] = dr["OutContractNo"].ToString();
// objData[i, 3] = dr["InCorpName"].ToString();
// objData[i, 4] = dr["OutCorpName"].ToString();
// objData[i, 5] = dr["TradeDirectionName"].ToString();
// objData[i, 6] = dr["PriceModeName"].ToString();
// objData[i, 7] = dr["TradeBorderName"].ToString();
// objData[i, 8] = dr["AssetName"].ToString();
// objData[i, 9] = dr["MUName"].ToString();
// objData[i, 10] = dr["CurrencyName"].ToString();
// objData[i, 11] = dr["SignAmount"].ToString();
// objData[i, 12] = dr["InAmount"].ToString();
// objData[i, 13] = dr["OutAmount"].ToString();
// objData[i, 14] = dr["PricingWeight"].ToString();
// objData[i, 15] = dr["AvgPrice"].ToString();
// objData[i, 16] = dr["ProAmount"].ToString();
// objData[i, 17] = dr["ProBala"].ToString();
// objData[i, 18] = dr["FinAmount"].ToString();
// objData[i, 19] = dr["FinBala"].ToString();
// objData[i, 20] = dr["OutBala"].ToString();
// objData[i, 21] = dr["InBala"].ToString();
// }
// return objData;
//}
public override DataTable SetExcelRangeData(DataTable source)
{
string[] strs = new string[] { "ContractDate", "ContractNo", "OutContractNo", "InCorpName", "OutCorpName", "TradeDirectionName", "PriceModeName", "TradeBorderName", "AssetName", "MUName", "CurrencyName", "SignAmount", "InAmount", "OutAmount", "PricingWeight", "AvgPrice", "ProAmount", "ProBala", "FinAmount", "FinBala", "OutBala", "InBala" };
return source.ConvertDataTable(strs);
}
示例4: SetExcelRangeData
//public override string[,] SetExcelRangeData(DataTable source)
//{
// string[,] objData = new string[source.Rows.Count, 10];
// for (int i = 0; i < source.Rows.Count; i++)
// {
// System.Data.DataRow dr = source.Rows[i];
// objData[i, 0] = dr["bgDate"].ToString();
// objData[i, 1] = dr["endDate"].ToString();
// objData[i, 2] = dr["outCorpName"].ToString();
// objData[i, 3] = dr["CurrencyName"].ToString();
// objData[i, 4] = dr["PreBala"].ToString();
// objData[i, 5] = dr["LastIssueBala"].ToString();
// objData[i, 6] = dr["LastCashInBala"].ToString();
// objData[i, 7] = dr["LastCollectBala"].ToString();
// objData[i, 8] = dr["LastPayBala"].ToString();
// objData[i, 9] = dr["LastBala"].ToString();
// }
// return objData;
//}
public override DataTable SetExcelRangeData(DataTable source)
{
string[] strs = new string[] { "bgDate", "endDate", "outCorpName", "CurrencyName", "PreBala", "LastIssueBala", "LastCashInBala", "LastCollectBala", "LastPayBala", "LastBala" };
return source.ConvertDataTable(strs);
}
示例5: SetExcelRangeData
//public override string[,] SetExcelRangeData(DataTable source)
//{
// string[,] objData = new string[source.Rows.Count, 9];
// for (int i = 0; i < source.Rows.Count; i++)
// {
// System.Data.DataRow dr = source.Rows[i];
// objData[i, 0] = dr["BankName"].ToString();
// objData[i, 1] = dr["RefNo"].ToString();
// objData[i, 2] = dr["NetAmount"].ToString();
// objData[i, 3] = dr["ContractNo"].ToString();
// objData[i, 4] = ((DateTime)dr["ApplyTime"]).ToString("yyyy-MM-dd");
// objData[i, 5] = dr["Hands"].ToString();
// objData[i, 6] = dr["Price"].ToString();
// objData[i, 7] = ((DateTime)dr["ExpiringDate"]).ToString("yyyy-MM-dd");
// objData[i, 8] = dr["nowPledgeAmount"].ToString();
// }
// return objData;
//}
public override DataTable SetExcelRangeData(DataTable source)
{
string[] strs = new string[] { "BankName", "RefNo", "NetAmount", "ContractNo", "ApplyTime", "Hands", "Price", "ExpiringDate", "nowPledgeAmount" };
return source.ConvertDataTable(strs);
//dt.Columns.Add(source.Columns["BankName"]);
//dt.Columns.Add(source.Columns["RefNo"]);
//dt.Columns.Add(source.Columns["NetAmount"]);
//dt.Columns.Add(source.Columns["ContractNo"]);
//dt.Columns.Add(source.Columns["ApplyTime"]);
//dt.Columns.Add(source.Columns["Hands"]);
//dt.Columns.Add(source.Columns["Price"]);
//dt.Columns.Add(source.Columns["ExpiringDate"]);
//dt.Columns.Add(source.Columns["nowPledgeAmount"]);
//return dt;
}
示例6: SetExcelRangeData
//public override string[,] SetExcelRangeData(DataTable source)
//{
// string[,] objData = new string[source.Rows.Count, 17];
// for (int i = 0; i < source.Rows.Count; i++)
// {
// System.Data.DataRow dr = source.Rows[i];
// objData[i, 0] = dr["PricingId"].ToString();
// objData[i, 1] = dr["ContractNo"].ToString();
// objData[i, 2] = dr["OutContractNo"].ToString();
// objData[i, 3] = dr["CorpName"].ToString();
// objData[i, 4] = dr["AssetName"].ToString();
// objData[i, 5] = dr["TradeCode"].ToString();
// objData[i, 6] = dr["ExchangeCode"].ToString();
// objData[i, 7] = dr["CurrencyName"].ToString();
// objData[i, 8] = dr["TurnoverHand"].ToString();
// objData[i, 9] = dr["Turnover"].ToString();
// objData[i, 10] = dr["PricingStyle"].ToString();
// objData[i, 11] = dr["SpotQP"].ToString();
// objData[i, 12] = dr["Spread"].ToString();
// objData[i, 13] = dr["Premium"].ToString();
// objData[i, 14] = dr["DelayFee"].ToString();
// objData[i, 15] = dr["OtherFee"].ToString();
// objData[i, 16] = dr["FinalPrice"].ToString();
// }
// return objData;
//}
public override DataTable SetExcelRangeData(DataTable source)
{
string[] strs = new string[] { "PricingId", "ContractNo", "OutContractNo", "CorpName", "AssetName", "TradeCode", "ExchangeCode", "CurrencyName", "TurnoverHand", "Turnover", "PricingStyle", "SpotQP", "Spread", "Premium", "DelayFee", "OtherFee", "FinalPrice" };
return source.ConvertDataTable(strs);
}
示例7: SetExcelRangeData
//public override string[,] SetExcelRangeData(DataTable source)
//{
// string[,] objData = new string[source.Rows.Count, 12];
// for (int i = 0; i < source.Rows.Count; i++)
// {
// System.Data.DataRow dr = source.Rows[i];
// objData[i, 0] = ((DateTime)dr["LogDate"]).ToString("yyyy-MM-dd");
// objData[i, 1] = dr["LogTypeName"].ToString();
// objData[i, 2] = dr["InCorpName"].ToString();
// objData[i, 3] = dr["InBankName"].ToString();
// objData[i, 4] = dr["InAccountNo"].ToString();
// objData[i, 5] = dr["OutCorpName"].ToString();
// objData[i, 6] = dr["OutBankName"].ToString();
// objData[i, 7] = dr["OutAccountNo"].ToString();
// objData[i, 8] = dr["PayModeName"].ToString();
// objData[i, 9] = dr["FundsBala"].ToString();
// objData[i, 10] = dr["CurrencyName"].ToString();
// objData[i, 11] = dr["IsVirtualPay"].ToString();
// }
// return objData;
//}
public override DataTable SetExcelRangeData(DataTable source)
{
string[] strs = new string[] { "LogDate", "LogTypeName", "InCorpName", "InBankName", "InAccountNo", "OutCorpName", "OutBankName", "OutAccountNo", "PayModeName", "FundsBala", "CurrencyName", "IsVirtualPay" };
return source.ConvertDataTable(strs);
}
示例8: SetExcelRangeData
//public override string[,] SetExcelRangeData(DataTable source)
//{
// string[,] objData = new string[source.Rows.Count, 15];
// for (int i = 0; i < source.Rows.Count; i++)
// {
// System.Data.DataRow dr = source.Rows[i];
// objData[i, 0] = ((DateTime)dr["StockDate"]).ToString("yyyy-MM-dd");
// objData[i, 1] = dr["RefNo"].ToString();
// objData[i, 2] = dr["AssetName"].ToString();
// objData[i, 3] = dr["BrandName"].ToString();
// objData[i, 4] = dr["DPName"].ToString();
// objData[i, 5] = dr["CardNo"].ToString();
// objData[i, 6] = dr["InBalaOutCorpName"].ToString();
// objData[i, 7] = dr["InBalaInCorpName"].ToString();
// objData[i, 8] = dr["InBala"].ToString();
// objData[i, 9] = dr["OutBalaInCorpName"].ToString();
// objData[i, 10] = dr["OutBalaOutCorpName"].ToString();
// objData[i, 11] = dr["OutBala"].ToString();
// objData[i, 12] = dr["SIBala"].ToString();
// objData[i, 13] = dr["ProfitBala"].ToString();
// objData[i, 14] = dr["CurrencyName"].ToString();
// }
// return objData;
//}
public override DataTable SetExcelRangeData(DataTable source)
{
string[] strs = new string[] { "StockDate", "RefNo", "AssetName", "BrandName", "DPName", "CardNo", "InBalaOutCorpName", "InBalaInCorpName", "InBala", "OutBalaInCorpName", "OutBalaOutCorpName", "OutBala", "SIBala", "ProfitBala", "CurrencyName" };
return source.ConvertDataTable(strs);
}
示例9: SetExcelRangeData
//public override string[,] SetExcelRangeData(DataTable source)
//{
// string[,] objData = new string[source.Rows.Count, 13];
// for (int i = 0; i < source.Rows.Count; i++)
// {
// System.Data.DataRow dr = source.Rows[i];
// objData[i, 0] = ((DateTime)dr["InvoiceDate"]).ToString("yyyy-MM-dd");
// objData[i, 1] = dr["InvoiceNo"].ToString();
// objData[i, 2] = dr["InvoiceName"].ToString();
// objData[i, 3] = dr["innerCorp"].ToString();
// objData[i, 4] = dr["outerCorp"].ToString();
// objData[i, 5] = dr["InvoiceDirection"].ToString();
// objData[i, 6] = dr["InvoiceType"].ToString();
// objData[i, 7] = dr["AssetName"].ToString();
// objData[i, 8] = dr["NetAmount"].ToString();
// objData[i, 9] = dr["MUName"].ToString();
// objData[i, 10] = dr["Bala"].ToString();
// objData[i, 11] = dr["CurrencyName"].ToString();
// objData[i, 12] = dr["RefNo"].ToString();
// }
// return objData;
//}
public override DataTable SetExcelRangeData(DataTable source)
{
string[] strs = new string[] { "InvoiceDate", "InvoiceNo", "InvoiceName", "innerCorp", "outerCorp", "InvoiceDirection", "InvoiceType", "AssetName", "NetAmount", "MUName", "Bala", "CurrencyName", "RefNo" };
return source.ConvertDataTable(strs);
}