Я являюсь приведенной ниже ошибкой при запуске моего кода для получения данных из базы данных Oracle.
[A] Oracle.ManagedDataAccess.Client.OracleParameter не может быть приведен к [B] Oracle.ManagedDataAccess.Client.OracleParameter.Тип A происходит от «Oracle.ManagedDataAccess, версия = 4.122.18.3, Culture = нейтральный, PublicKeyToken = 89b483f429c47342» в контексте «LoadFrom» в расположении «d: \ Users \ mukadfar \ AppData \ Local \ Temp \ Temporary ASP.NET Files».\ против \ 02d43168 \ 78988466 \ сборка \ DL3 \ 95159e45 \ 00d2c436_a83bd401 \ Oracle.ManagedDataAccess.dll.Тип B происходит из «Oracle.ManagedDataAccess, версия = 4.122.1.0, Culture = нейтральный, PublicKeyToken = 89b483f429c47342» в контексте «По умолчанию» в расположении «d: \ Users \ mukadfar \ AppData \ Local \ Temp \ Temporary ASP.NET Files».\ vs \ 02d43168 \ 78988466 \ assembly \ dl3 \ 0b972c52 \ 00ac59cd_7dd5d201 \ Oracle.ManagedDataAccess.dll '.
Вот мой код для того же:
var param1 = "K60";
var param2 = "2018.09.14";
var param3 = "2018.09.14";
var param4 = string.Empty;
var param5 = string.Empty;
var param6 = string.Empty;
var param7 = string.Empty;
var param8 = string.Empty;
var param9 = string.Empty;
var param10 = string.Empty;
var param11 = string.Empty;
var param12 = string.Empty;
var param13 = string.Empty;
var param14 = string.Empty;
var param15 = string.Empty;
var param16 = string.Empty;
var param17 = string.Empty;
var param18 = string.Empty;
var parameters = new[]
{
new OracleParameter("wr_proccode_PM_cmb_C179", OracleDbType.Varchar2, 100, param1 != null ? (object)param1 : DBNull.Value, ParameterDirection.Input),
new OracleParameter("wr_start_day_C179", OracleDbType.Varchar2, 100, param2 != null ? (object)param2 : DBNull.Value, ParameterDirection.Input),
new OracleParameter("wr_end_day_C179", OracleDbType.Varchar2, 100, param1 != null ? (object)param3 : DBNull.Value, ParameterDirection.Input),
new OracleParameter("wr_operating_efficiency_total", OracleDbType.Decimal, 4000, param4 != null ? (object)param4 : DBNull.Value, ParameterDirection.InputOutput),
new OracleParameter("wr_time_efficiency", OracleDbType.Decimal, 4000, param5 != null ? (object)param5 : DBNull.Value, ParameterDirection.InputOutput),
new OracleParameter("wr_tons_efficiency_total", OracleDbType.Decimal, 4000, param6 != null ? (object)param6 : DBNull.Value, ParameterDirection.InputOutput),
new OracleParameter("wr_pope_gross", OracleDbType.Decimal, 4000, param7 != null ? (object)param7 : DBNull.Value, ParameterDirection.InputOutput),
new OracleParameter("wr_packed_net_prod", OracleDbType.Decimal, 4000, param8 != null ? (object)param8 : DBNull.Value, ParameterDirection.InputOutput),
new OracleParameter("wr_bottom_waste", OracleDbType.Decimal, 4000, param9 != null ? (object)param9 : DBNull.Value, ParameterDirection.InputOutput),
new OracleParameter("wr_avg_gm2", OracleDbType.Decimal, 4000, param10 != null ? (object)param10 : DBNull.Value, ParameterDirection.InputOutput),
new OracleParameter("wr_unplanned_shutdown_pcs", OracleDbType.Int32, 4000, param11 != null ? (object)param11 : DBNull.Value, ParameterDirection.InputOutput),
new OracleParameter("wr_grade_change_pcs", OracleDbType.Int32, 4000, param12 != null ? (object)param12 : DBNull.Value, ParameterDirection.InputOutput),
new OracleParameter("wr_break_pcs", OracleDbType.Int32, 4000, param13 != null ? (object)param13 : DBNull.Value, ParameterDirection.InputOutput),
new OracleParameter("wr_break_hr", OracleDbType.Varchar2, 4000, param14 != null ? (object)param14 : DBNull.Value, ParameterDirection.InputOutput),
new OracleParameter("wr_unplanned_shutdown_hr", OracleDbType.Varchar2, 4000, param15 != null ? (object)param15 : DBNull.Value, ParameterDirection.InputOutput),
new OracleParameter("wr_packed_net_prod_pcs", OracleDbType.Int32, 4000, param16 != null ? (object)param16 : DBNull.Value, ParameterDirection.InputOutput),
new OracleParameter("wr_rewinder_net_prod_pcs", OracleDbType.Decimal, 4000, param17 != null ? (object)param17 : DBNull.Value, ParameterDirection.InputOutput),
new OracleParameter("wr_warehouse_post_waste", OracleDbType.Decimal, 4000, param18 != null ? (object)param18 : DBNull.Value, ParameterDirection.InputOutput)
};
var procedure = $"Begin TP_BALELINE.getNextPlannedObjects(:wr_proccode_PM_cmb_C179, :wr_start_day_C179, :wr_end_day_C179, :wr_operating_efficiency_total, :wr_time_efficiency, :wr_tons_efficiency_total, :wr_pope_gross, :wr_packed_net_prod, :wr_bottom_waste, :wr_avg_gm2, :wr_unplanned_shutdown_pcs, :wr_grade_change_pcs, :wr_break_pcs, :wr_break_hr, :wr_unplanned_shutdown_hr, :wr_packed_net_prod_pcs, :wr_rewinder_net_prod_pcs, :wr_warehouse_post_waste); END;";
this.databaseContext.ExecuteSqlCommand(
procedure,
parameters[0],
parameters[1],
parameters[2],
parameters[3],
parameters[4],
parameters[5],
parameters[6],
parameters[7],
parameters[8],
parameters[9],
parameters[10],
parameters[11],
parameters[12],
Получениеошибка в строке ExecuteSqlCommand.