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


C# OracleConnection.GetType方法代码示例

本文整理汇总了C#中System.Data.OracleClient.OracleConnection.GetType方法的典型用法代码示例。如果您正苦于以下问题:C# OracleConnection.GetType方法的具体用法?C# OracleConnection.GetType怎么用?C# OracleConnection.GetType使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在System.Data.OracleClient.OracleConnection的用法示例。


在下文中一共展示了OracleConnection.GetType方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: run

		public void run()
		{
			Exception exp = null;
			IDbConnection ICon = new OracleConnection();

			try
			{
				BeginCase("check IDbConnection is null");
				Compare(ICon != null, true);
			} 
			catch(Exception ex){exp = ex;}
			finally{EndCase(exp); exp = null;}

			try
			{
				BeginCase("check IDbConnection type");
				Compare(ICon.GetType().FullName ,typeof(OracleConnection).FullName);
			} 
			catch(Exception ex){exp = ex;}
			finally{EndCase(exp); exp = null;}

			ICon = new OracleConnection(_ConnectionString);

			try
			{
				BeginCase("check IDbConnection connection string");
				Compare(ICon.ConnectionString ,_ConnectionString);
			} 
			catch(Exception ex){exp = ex;}
			finally{EndCase(exp); exp = null;}

			try
			{
				BeginCase("check IDbConnection ConnectionTimeout");
				Compare(ICon.ConnectionTimeout ,15);
			} 
			catch(Exception ex){exp = ex;}
			finally{EndCase(exp); exp = null;}

			try
			{
				BeginCase("check IDbConnection state - closed");
				Compare(ICon.State ,ConnectionState.Closed);
			} 
			catch(Exception ex){exp = ex;}
			finally{EndCase(exp); exp = null;}

			ICon.Open();

			try
			{
				BeginCase("check IDbConnection - open");
				Compare(ICon.State ,ConnectionState.Open );
			} 
			catch(Exception ex){exp = ex;}
			finally{EndCase(exp); exp = null;}

			try
			{
				BeginCase("check IDbConnection CreateCommand");
				IDbCommand cmd = ICon.CreateCommand();
				Compare(cmd.GetType().FullName ,typeof(OracleCommand).FullName);
			} 
			catch(Exception ex){exp = ex;}
			finally{EndCase(exp); exp = null;}

			if (ICon.State == ConnectionState.Open) ICon.Close();

		}
开发者ID:nlhepler,项目名称:mono,代码行数:69,代码来源:IDBConnection_For_Oracle.cs


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