当前位置: 首页>>代码示例>>C#>>正文


C# OracleDataAdapter.FillSchema方法代码示例

本文整理汇总了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();
        }
开发者ID:fightingxu,项目名称:mkttrans,代码行数:13,代码来源:DataLayer.cs

示例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;
		}
	}
开发者ID:nlhepler,项目名称:mono,代码行数:39,代码来源:OracleDataAdapter_FillSchema_DsSt.cs


注:本文中的System.Data.OracleClient.OracleDataAdapter.FillSchema方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。