1.
用查询,然后填充前端的数据集,(大多数情况)2.
如果用.net的oracleClient的话,可以直接从过程中返回一个记录集,(.net2003+oracle817 release3+)3.
如果记录不是很多,可以考虑返回一个字符串,在前端处理.

解决方案 »

  1.   

    #region 填充记录集
    private void Fillds()
    { this.ds.Tables.Clear();
    this.ds.Clear(); string sql;
    sql="select * from ERP_T_USER";  //这里是你的查询语句.
    SqlDataAdapter da=new SqlDataAdapter(sql,new clsPublic().ConnectSqlServer());
    try
    {
    da.Fill(ds,"User");
    this.lblCount.Text="总共"+this.ds.Tables["User"].Rows.Count.ToString()+"条记录";
    }
    catch(Exception ex)
    {
    MessageBox.Show("查询记录时出错,出错信息为:"+ex.Message,"出错",MessageBoxButtons.OK,MessageBoxIcon.Error);
    }
    finally
    {
    if (da.SelectCommand.Connection.State==ConnectionState.Open)
    {
    da.SelectCommand.Connection.Close();
    da.SelectCommand.Connection.Dispose();
    da.Dispose();
    }
    }
    }--当然,使用前要定义DataSet,要引用,要建连接等等.
      

  2.   

    查询语句不是写在存储过程里的吗?为什么会写在前端程序的?
    是不是在存储过程里把查询出来的结果插入ERP_T_USER表,然后在前端在查询出来啊?
    (我是用PHP的,但我想方法应该相同的吧)
      

  3.   

    你可以用oracle过程返回记录集的方法来执行.就是上面的第二种方法了.上面的例子是: 把select * from 表名   这个查询传到oracle数据库中执行,然后返回结果集.表是oracle数据库中的表。