MyException - 我的异常网
当前位置:我的异常网» C# » C#操作ORACLE 的XML有关问题

C#操作ORACLE 的XML有关问题

www.MyException.Cn  网友分享于:2013-12-12  浏览:134次
C#操作ORACLE 的XML问题
在SQL中,执行一条SQL语句会返回到XML中,在ORACLE中就没有这个功能了.

private XmlReader GetParameters()
{
String sqlStr = "SELECT B.[name], C.[name] AS [type], B.length, B.isoutparam, B.isnullable";
sqlStr += " FROM sysobjects AS A INNER JOIN";
sqlStr += " syscolumns AS B ON A.id = B.id AND A.xtype = 'P' AND A.name = '" + _Procedure + "' INNER JOIN";
sqlStr += " systypes C ON B.xtype = C.xtype AND C.[name] <> 'sysname'";
sqlStr += " ORDER BY ROW_NUMBER() OVER (ORDER BY B.id), B.isoutparam";
sqlStr += " FOR XML RAW";
OracleCommand sqlCmd = new OracleCommand(sqlStr, _SqlConnection);
// <row name="Action" type="varchar" length="50" isoutparam="0" isnullable="1" />
XmlReader sqlXmlReader = null;
try
{
   
sqlXmlReader = sqlCmd.ExecuteXmlReader(); //没有这个方法了ExecuteXmlReader();  
   
   
   
}
catch (Exception ex)
{
if (sqlXmlReader != null) sqlXmlReader.Close();
sqlXmlReader = null;
_LastError = "get parameters error: " + ex.Message;
}
finally
{
sqlCmd.Dispose();
sqlCmd = null;
}
return sqlXmlReader;
}
请高手指点迷津.

------解决方案--------------------
用过一次,全部读出来,改了以后再全部存回去

文章评论

软件开发程序错误异常ExceptionCopyright © 2009-2015 MyException 版权所有