oracle存储过程如下CREATE OR REPLACE PROCEDURE P_GETALLDOC( CFLOWSN IN NUMBER, v_rt out sys_refcursor)
AS
BEGIN
open v_rt for
select Flowsn,Attachid as id,attachfile as name from ATTACH where flowsn=CFLOWSN
union all
select flowsn,eformid as id,formname as name from flowforms where flowsn=CFLOWSN;END P_GETALLDOC;调用过程如下:OracleParameter[] paras = new OracleParameter[2];
paras[0] = new OracleParameter("CFLOWSN", OracleType.Number,12);
paras[0].Value = Convert.ToInt32(flowsn);
paras[0].Direction = ParameterDirection.Input;
paras[1] = new OracleParameter("v_rt", OracleType.Cursor);
paras[1].Direction = ParameterDirection.Output;
string connString = ConfigurationManager.AppSettings["ConnString"]; var conn = new OracleConnection(connString);
conn.Open();
OracleCommand oraCmd = new OracleCommand("P_GETALLDOC", conn);
oraCmd.CommandType = CommandType.StoredProcedure;
oraCmd.Parameters.Clear();//先清空
foreach (OracleParameter parme in paras)
{
oraCmd.Parameters.Add(parme);
}
DataTable table = new DataTable();
OracleDataAdapter da1 = new OracleDataAdapter(oraCmd);//取出数据
da1.Fill(table);
//没有记录,实际是有的
if (table.Rows.Count > 0)
{
context.Response.Write("记录:" + table.Rows.Count);
}
AS
BEGIN
open v_rt for
select Flowsn,Attachid as id,attachfile as name from ATTACH where flowsn=CFLOWSN
union all
select flowsn,eformid as id,formname as name from flowforms where flowsn=CFLOWSN;END P_GETALLDOC;调用过程如下:OracleParameter[] paras = new OracleParameter[2];
paras[0] = new OracleParameter("CFLOWSN", OracleType.Number,12);
paras[0].Value = Convert.ToInt32(flowsn);
paras[0].Direction = ParameterDirection.Input;
paras[1] = new OracleParameter("v_rt", OracleType.Cursor);
paras[1].Direction = ParameterDirection.Output;
string connString = ConfigurationManager.AppSettings["ConnString"]; var conn = new OracleConnection(connString);
conn.Open();
OracleCommand oraCmd = new OracleCommand("P_GETALLDOC", conn);
oraCmd.CommandType = CommandType.StoredProcedure;
oraCmd.Parameters.Clear();//先清空
foreach (OracleParameter parme in paras)
{
oraCmd.Parameters.Add(parme);
}
DataTable table = new DataTable();
OracleDataAdapter da1 = new OracleDataAdapter(oraCmd);//取出数据
da1.Fill(table);
//没有记录,实际是有的
if (table.Rows.Count > 0)
{
context.Response.Write("记录:" + table.Rows.Count);
}
解决方案 »
- 请问这种Clik事件可不可以简化
- ftp下载功能在不同的机子上,不能使用,为什么?
- 如何获取已发送字节数 smtpclient
- 急!在线等!!C#中ZedGraph怎样画销量曲线
- 急啊!关于 CrystalReport 打印树(treeView)数据的问题!!! 高手救救
- 求助:关于使用AxWebBrowser的问题
- 再次请教,还没有解决
- 如何使用水晶报表,设计显示一个图像字段?
- 特菜问题,如何随Form的改变,内部控件自动调整大小?
- 微软回用c#开发windows吗?
- C#调用Web接口数据量大还没接收完数据就提示超时怎么办?
- 求解:c#是否有什么类方法,可以获得一个URL下面的所有目录和文件信息?
1.存储过程是否在oracle创建,重新编译是否成功
2.调试存储过程查看v_rt值是否有
3.若存储过程测试无值,把sql语句提出执行检查