本文整理汇总了C#中OracleCommand.ExecuteXmlReader方法的典型用法代码示例。如果您正苦于以下问题:C# OracleCommand.ExecuteXmlReader方法的具体用法?C# OracleCommand.ExecuteXmlReader怎么用?C# OracleCommand.ExecuteXmlReader使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类OracleCommand
的用法示例。
在下文中一共展示了OracleCommand.ExecuteXmlReader方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ExecuteSqlXmlReader
public XmlReader ExecuteSqlXmlReader(string sql)
{
XmlReader reader;
OracleCommand cmd = new OracleCommand();
this.Connect();
cmd.CommandTimeout = this.CommandTimeout;
cmd.CommandText = sql;
cmd.Connection = _connection;
//if (_transaction != null) cmd.Transaction = _transaction;
cmd.CommandType = CommandType.Text;
reader = cmd.ExecuteXmlReader();
cmd.Dispose();
return reader;
}
示例2: DoExecuteXmlReader
/// <summary>
/// Does the execute XML reader.
/// </summary>
/// <param name="oracleCommand">The oracle command.</param>
/// <returns></returns>
/// <remarks>
/// Execute the actual XML Reader call.
/// </remarks>
private XmlReader DoExecuteXmlReader(OracleCommand oracleCommand)
{
try
{
DateTime startTime = DateTime.Now;
XmlReader reader = oracleCommand.ExecuteXmlReader();
instrumentationProvider.FireCommandExecutedEvent(startTime);
return reader;
}
catch (Exception e)
{
instrumentationProvider.FireCommandFailedEvent(oracleCommand.CommandText, ConnectionStringNoCredentials, e);
throw;
}
}
示例3: ExecuteSPXmlReader
public XmlReader ExecuteSPXmlReader(string procedureName)
{
XmlReader reader;
OracleCommand cmd = new OracleCommand();
this.Connect();
cmd.CommandTimeout = this.CommandTimeout;
cmd.CommandText = procedureName;
cmd.Connection = _connection;
//if (_transaction != null) cmd.Transaction = _transaction;
cmd.CommandType = CommandType.StoredProcedure;
this.CopyParameters(cmd);
reader = cmd.ExecuteXmlReader();
_parameterCollection = cmd.Parameters;
cmd.Dispose();
return reader;
}
示例4: DoExecuteXmlReader
/// <summary>
/// Does the execute XML reader.
/// </summary>
/// <param name="oracleCommand">The oracle command.</param>
/// <returns></returns>
/// <remarks>
/// Execute the actual XML Reader call.
/// </remarks>
private XmlReader DoExecuteXmlReader(OracleCommand oracleCommand) {
try {
return oracleCommand.ExecuteXmlReader();
}
catch(Exception ex) {
if(log.IsErrorEnabled)
log.ErrorException("XmlReader를 읽는데 실패했습니다.", ex);
throw;
}
}