本文整理汇总了C#中System.Data.OracleClient.OracleDataAdapter.FillSchema方法的典型用法代码示例。如果您正苦于以下问题:C# OracleDataAdapter.FillSchema方法的具体用法?C# OracleDataAdapter.FillSchema怎么用?C# OracleDataAdapter.FillSchema使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Data.OracleClient.OracleDataAdapter
的用法示例。
在下文中一共展示了OracleDataAdapter.FillSchema方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: FillSchema
public void FillSchema( string sqlQuery,DataSet dataSet,string tableName)
{
if (Connection.State == ConnectionState.Closed)
{
Connection.Open();
}
command.CommandText = sqlQuery;
OracleDataAdapter oraDA = new OracleDataAdapter();
oraDA.SelectCommand = command;
oraDA.FillSchema(dataSet, SchemaType.Mapped, tableName);
Connection.Close();
}
示例2: TestLongSqlExpression
public void TestLongSqlExpression()
{
BeginCase("Long SQL string cause java.lang.StackOverflowError (Test case for bug #4708)");
StringBuilder querySb = new StringBuilder();
querySb.Append("SELECT ");
querySb.Append("c.CustomerID as ci1, c.CustomerID as ci2, c.CustomerID as ci3, c.CustomerID as ci4, ");
querySb.Append("c.CompanyName as cn1, c.CompanyName as cn2, c.CompanyName as cn3, c.CompanyName as cn4, ");
querySb.Append("c.ContactName as cntn1, c.ContactName as cntn2, c.ContactName as cntn3, c.ContactName as cntn4, ");
querySb.Append("c.ContactTitle as ct1, c.ContactTitle as ct2, c.ContactTitle as ct3, c.ContactTitle as ct4, ");
querySb.Append("c.Address as ad1, c.Address as ad2, c.Address as ad3, c.Address as ad4, ");
querySb.Append("c.City as ct1, c.City as ct2, c.City as ct3, c.City as ct4, ");
querySb.Append("c.Region as rg1, c.Region as rg2, c.Region as rg3, c.Region as rg4, ");
querySb.Append("c.PostalCode as pc1, c.PostalCode as pc2, c.PostalCode as pc3, c.PostalCode as pc4, ");
querySb.Append("c.Country as co1, c.Country as co2, c.Country as co3, c.Country as co4, ");
querySb.Append("c.Phone as ph1, c.Phone as ph2, c.Phone as ph3, c.Phone as ph4, ");
querySb.Append("c.Fax as fx1, c.Fax as fx2, c.Fax as fx3, c.Fax as fx4 ");
querySb.Append("FROM Customers c");
OracleDataAdapter adapter = null;
DataSet schemaDs = new DataSet();
try
{
using(adapter = new OracleDataAdapter(querySb.ToString(), this.connectionString))
{
adapter.MissingSchemaAction = MissingSchemaAction.AddWithKey;
adapter.FillSchema(schemaDs, SchemaType.Source);
Compare(schemaDs.Tables.Count, 1);
}
}
catch(Exception ex)
{
exp = ex;
}
finally
{
EndCase(exp);
exp = null;
}
}