我想使用存储过程从数据库中获取多条记录。我想从我的 ASPX 应用程序中调用该过程。怎么可能??
我正在尝试的任何事情如下:
Oracle 存储过程:
CREATE OR REPLACE PROCEDURE GET_DDO
(
TCODE IN VARCHAR2
, DDOCODE_var OUT VARCHAR2
) AS
BEGIN
select ddocode into ddocode_var from ddo;
END GET_DDO;
我的 .CS 代码:
myconnection.ConnectionString = conString;
using (myconnection)
{
myconnection.Open();
myadapter.SelectCommand = new OleDbCommand("Get_DDO", myconnection);
myadapter.SelectCommand.CommandType = CommandType.StoredProcedure;
myadapter.SelectCommand.Parameters.Add("TCode", OleDbType.VarChar).Value = treasuryCode;
myadapter.SelectCommand.Parameters.Add("DDOCOde",OleDbType.Varchar).Direction=ParameterDirection.Output;
myadapter.Fill(mydataset);
myconnection.Close();
return mydataset;
}