yasser777 / nettiers

Automatically exported from code.google.com/p/nettiers
0 stars 0 forks source link

OracleClient Error ExecuteDataSet and ExecuteReader without Command #313

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
most of Times We Use DataAccess Layer Without using OracleClient Layer,so We 
Don't have ConnectingString And otherInfo USe Command Paramer,

Original issue reported on code.google.com by huangqiu...@gmail.com on 10 Jun 2010 at 12:11

GoogleCodeExporter commented 9 years ago
Hello,

You will need to include the OracleClient layer otherwise you will run into 
issues like this. Why did you choose to exclude this layer?

Thanks
-Blake Niemyjski

Original comment by bniemyjski on 10 Jun 2010 at 2:41

GoogleCodeExporter commented 9 years ago
sorry,my english is so pool.
i mean ,when use code like this:
 reader = Data.DataRepository.Provider.ExecuteReader("proc_Right_Operation_GetByUPId",User.UserId,ProgramID);

or 
 Data.DataRepository.Provider.ExecuteDataSet("proc_Right_Operation_GetByUPId",User.UserId,ProgramID);

it's error becourse there's a out cursur in proccdure

I FIX'T this like flow:
public override IDataReader ExecuteReader(string storedProcedureName, params 
object[] parameterValues)
        {
            OracleDatabase database = new OracleDatabase(this._connectionString);
            DbCommand command = database.GetStoredProcCommand(storedProcedureName);
            DbCommand Precommand = database.GetStoredProcCommand(storedProcedureName);
            Precommand.Connection = database.CreateConnection();
            Precommand.Connection.Open();
            OracleCommandBuilder.DeriveParameters((OracleCommand)Precommand);
            for (int i = 0; i < parameterValues.Length; i++)
            {
                database.AddInParameter(command,Precommand.Parameters[i].ParameterName,Precommand.Parameters[i].DbType,parameterValues[i]);
            }

            return database.ExecuteReader(command);

        }

Original comment by huangqiu...@gmail.com on 11 Jun 2010 at 2:24

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
Hello,

Can you try to reproduce this with the latest nightly build of the templates.

Thanks
-Blake Niemyjski

Original comment by bniemyjski on 15 Jun 2010 at 1:23