首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > .NET > C# >

C#操作ORACLE 的XML有关问题

2011-12-11 
C#操作ORACLE 的XML问题在SQL中,执行一条SQL语句会返回到XML中,在ORACLE中就没有这个功能了.private XmlRe

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;
}
请高手指点迷津.

[解决办法]
用过一次,全部读出来,改了以后再全部存回去

热点排行