本文整理汇总了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();
}