data types .NET vs OleDb

Ex_Soft
Дата: 23.03.2005 10:49:27
SyBase ASE 12.5

создал для теста типов ХП
create procedure sp_TestTypes 
  @FDecimal_4_0 decimal(4,0),
  @FDecimal_4_2 decimal(4,2),
  @FDecimal_5_0 decimal(5,0),
  @FDecimal_5_2 decimal(5,2),
  @FDecimal_8_0 decimal(8,0),
  @FDecimal_8_2 decimal(8,2),
  @FDecimal_9_0 decimal(9,0),
  @FDecimal_9_2 decimal(9,2),
  @FDecimal_10_0 decimal(10,0),
  @FDecimal_10_2 decimal(10,2),
  @FDecimal_18_0 decimal(18,0),
  @FDecimal_18_2 decimal(18,2),
  @FNumeric_4_0 numeric(4,0),
  @FNumeric_4_2 numeric(4,2),
  @FNumeric_5_0 numeric(5,0),
  @FNumeric_5_2 numeric(5,2),
  @FNumeric_8_0 numeric(8,0),
  @FNumeric_8_2 numeric(8,2),
  @FNumeric_9_0 numeric(9,0),
  @FNumeric_9_2 numeric(9,2),
  @FNumeric_10_0 numeric(10,0),
  @FNumeric_10_2 numeric(10,2),
  @FNumeric_18_0 numeric(18,0),
  @FNumeric_18_2 numeric(18,2),
  @FMoney money,
  @FDecimal_4_0_out decimal(4,0) output,
  @FDecimal_4_2_out decimal(4,2) output,
  @FDecimal_5_0_out decimal(5,0) output,
  @FDecimal_5_2_out decimal(5,2) output,
  @FDecimal_8_0_out decimal(8,0) output,
  @FDecimal_8_2_out decimal(8,2) output,
  @FDecimal_9_0_out decimal(9,0) output,
  @FDecimal_9_2_out decimal(9,2) output,
  @FDecimal_10_0_out decimal(10,0) output,
  @FDecimal_10_2_out decimal(10,2) output,
  @FDecimal_18_0_out decimal(18,0) output,
  @FDecimal_18_2_out decimal(18,2) output,
  @FNumeric_4_0_out numeric(4,0) output,
  @FNumeric_4_2_out numeric(4,2) output,
  @FNumeric_5_0_out numeric(5,0) output,
  @FNumeric_5_2_out numeric(5,2) output,
  @FNumeric_8_0_out numeric(8,0) output,
  @FNumeric_8_2_out numeric(8,2) output,
  @FNumeric_9_0_out numeric(9,0) output,
  @FNumeric_9_2_out numeric(9,2) output,
  @FNumeric_10_0_out numeric(10,0) output,
  @FNumeric_10_2_out numeric(10,2) output,
  @FNumeric_18_0_out numeric(18,0) output,
  @FNumeric_18_2_out numeric(18,2) output,
  @FMoney_out money output
as 
begin
  declare
    @RetVal int

  select @FDecimal_4_0_out = @FDecimal_4_0
  select @FDecimal_4_2_out = @FDecimal_4_2
  select @FDecimal_5_0_out = @FDecimal_5_0
  select @FDecimal_5_2_out = @FDecimal_5_2
  select @FDecimal_8_0_out = @FDecimal_8_0
  select @FDecimal_8_2_out = @FDecimal_8_2
  select @FDecimal_9_0_out = @FDecimal_9_0
  select @FDecimal_9_2_out = @FDecimal_9_2
  select @FDecimal_10_0_out = @FDecimal_10_0
  select @FDecimal_10_2_out = @FDecimal_10_2
  select @FDecimal_18_0_out = @FDecimal_18_0
  select @FDecimal_18_2_out = @FDecimal_18_2
  select @FNumeric_4_0_out = @FNumeric_4_0
  select @FNumeric_4_2_out = @FNumeric_4_2
  select @FNumeric_5_0_out = @FNumeric_5_0
  select @FNumeric_5_2_out = @FNumeric_5_2
  select @FNumeric_8_0_out = @FNumeric_8_0
  select @FNumeric_8_2_out = @FNumeric_8_2
  select @FNumeric_9_0_out = @FNumeric_9_0
  select @FNumeric_9_2_out = @FNumeric_9_2
  select @FNumeric_10_0_out = @FNumeric_10_0
  select @FNumeric_10_2_out = @FNumeric_10_2
  select @FNumeric_18_0_out = @FNumeric_18_0
  select @FNumeric_18_2_out = @FNumeric_18_2
  select @FMoney_out = @FMoney

  select @RetVal=65535 
 
  return(@RetVal)
end

OleDbCommandBuilder.DeriveParameters()

RETURN_VALUE
Direction: ReturnValue
OleDbType: Integer
DbType: Int32

FDecimal_4_0
Direction: Input
OleDbType: Numeric
DbType: Decimal

FDecimal_4_2
Direction: Input
OleDbType: Numeric
DbType: Decimal

FDecimal_5_0
Direction: Input
OleDbType: Numeric
DbType: Decimal

FDecimal_5_2
Direction: Input
OleDbType: Numeric
DbType: Decimal

FDecimal_8_0
Direction: Input
OleDbType: Numeric
DbType: Decimal

FDecimal_8_2
Direction: Input
OleDbType: Numeric
DbType: Decimal

FDecimal_9_0
Direction: Input
OleDbType: Numeric
DbType: Decimal

FDecimal_9_2
Direction: Input
OleDbType: Numeric
DbType: Decimal

FDecimal_10_0
Direction: Input
OleDbType: Numeric
DbType: Decimal

FDecimal_10_2
Direction: Input
OleDbType: Numeric
DbType: Decimal

FDecimal_18_0
Direction: Input
OleDbType: Numeric
DbType: Decimal

FDecimal_18_2
Direction: Input
OleDbType: Numeric
DbType: Decimal

FNumeric_4_0
Direction: Input
OleDbType: Numeric
DbType: Decimal

FNumeric_4_2
Direction: Input
OleDbType: Numeric
DbType: Decimal

FNumeric_5_0
Direction: Input
OleDbType: Numeric
DbType: Decimal

FNumeric_5_2
Direction: Input
OleDbType: Numeric
DbType: Decimal

FNumeric_8_0
Direction: Input
OleDbType: Numeric
DbType: Decimal

FNumeric_8_2
Direction: Input
OleDbType: Numeric
DbType: Decimal

FNumeric_9_0
Direction: Input
OleDbType: Numeric
DbType: Decimal

FNumeric_9_2
Direction: Input
OleDbType: Numeric
DbType: Decimal

FNumeric_10_0
Direction: Input
OleDbType: Numeric
DbType: Decimal

FNumeric_10_2
Direction: Input
OleDbType: Numeric
DbType: Decimal

FNumeric_18_0
Direction: Input
OleDbType: Numeric
DbType: Decimal

FNumeric_18_2
Direction: Input
OleDbType: Numeric
DbType: Decimal

FMoney
Direction: Input
OleDbType: Currency
DbType: Currency

FDecimal_4_0_out
Direction: Output
OleDbType: Numeric
DbType: Decimal

FDecimal_4_2_out
Direction: Output
OleDbType: Numeric
DbType: Decimal

FDecimal_5_0_out
Direction: Output
OleDbType: Numeric
DbType: Decimal

FDecimal_5_2_out
Direction: Output
OleDbType: Numeric
DbType: Decimal

FDecimal_8_0_out
Direction: Output
OleDbType: Numeric
DbType: Decimal

FDecimal_8_2_out
Direction: Output
OleDbType: Numeric
DbType: Decimal

FDecimal_9_0_out
Direction: Output
OleDbType: Numeric
DbType: Decimal

FDecimal_9_2_out
Direction: Output
OleDbType: Numeric
DbType: Decimal

FDecimal_10_0_out
Direction: Output
OleDbType: Numeric
DbType: Decimal

FDecimal_10_2_out
Direction: Output
OleDbType: Numeric
DbType: Decimal

FDecimal_18_0_out
Direction: Output
OleDbType: Numeric
DbType: Decimal

FDecimal_18_2_out
Direction: Output
OleDbType: Numeric
DbType: Decimal

FNumeric_4_0_out
Direction: Output
OleDbType: Numeric
DbType: Decimal

FNumeric_4_2_out
Direction: Output
OleDbType: Numeric
DbType: Decimal

FNumeric_5_0_out
Direction: Output
OleDbType: Numeric
DbType: Decimal

FNumeric_5_2_out
Direction: Output
OleDbType: Numeric
DbType: Decimal

FNumeric_8_0_out
Direction: Output
OleDbType: Numeric
DbType: Decimal

FNumeric_8_2_out
Direction: Output
OleDbType: Numeric
DbType: Decimal

FNumeric_9_0_out
Direction: Output
OleDbType: Numeric
DbType: Decimal

FNumeric_9_2_out
Direction: Output
OleDbType: Numeric
DbType: Decimal

FNumeric_10_0_out
Direction: Output
OleDbType: Numeric
DbType: Decimal

FNumeric_10_2_out
Direction: Output
OleDbType: Numeric
DbType: Decimal

FNumeric_18_0_out
Direction: Output
OleDbType: Numeric
DbType: Decimal

FNumeric_18_2_out
Direction: Output
OleDbType: Numeric
DbType: Decimal

FMoney_out
Direction: Output
OleDbType: Currency
DbType: Currency

вызываю
cmd.CommandText="{? = call sp_TestTypes(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)}";
cmd.Parameters.Clear();

SPRetValue=cmd.Parameters.Add("@return",SqlDbType.Int);
SPRetValue.Direction=ParameterDirection.ReturnValue;

cmd.Parameters.Add("@FDecimal_4_0",OleDbType.Numeric).Value=9999;
cmd.Parameters.Add("@FDecimal_4_2",OleDbType.Numeric).Value=9999.99;
cmd.Parameters.Add("@FDecimal_5_0",OleDbType.Numeric).Value=99999;
cmd.Parameters.Add("@FDecimal_5_2",OleDbType.Numeric).Value=99999.99;
cmd.Parameters.Add("@FDecimal_8_0",OleDbType.Numeric).Value=99999999;
cmd.Parameters.Add("@FDecimal_8_2",OleDbType.Numeric).Value=99999999.99;
cmd.Parameters.Add("@FDecimal_9_0",OleDbType.Numeric).Value=999999999;
cmd.Parameters.Add("@FDecimal_9_2",OleDbType.Numeric).Value=999999999.99;
cmd.Parameters.Add("@FDecimal_10_0",OleDbType.Numeric).Value=9999999999;
cmd.Parameters.Add("@FDecimal_10_2",OleDbType.Numeric).Value=9999999999.99;
cmd.Parameters.Add("@FDecimal_18_0",OleDbType.Numeric).Value=999999999999999999;
cmd.Parameters.Add("@FDecimal_18_2",OleDbType.Numeric).Value=999999999999999999.99;
cmd.Parameters.Add("@FNumeric_4_0",OleDbType.Numeric).Value=9999;
cmd.Parameters.Add("@FNumeric_4_2",OleDbType.Numeric).Value=9999.99;
cmd.Parameters.Add("@FNumeric_5_0",OleDbType.Numeric).Value=99999;
cmd.Parameters.Add("@FNumeric_5_2",OleDbType.Numeric).Value=99999.99;
cmd.Parameters.Add("@FNumeric_8_0",OleDbType.Numeric).Value=99999999;
cmd.Parameters.Add("@FNumeric_8_2",OleDbType.Numeric).Value=99999999.99;
cmd.Parameters.Add("@FNumeric_9_0",OleDbType.Numeric).Value=999999999;
cmd.Parameters.Add("@FNumeric_9_2",OleDbType.Numeric).Value=999999999.99;
cmd.Parameters.Add("@FNumeric_10_0",OleDbType.Numeric).Value=9999999999;
cmd.Parameters.Add("@FNumeric_10_2",OleDbType.Numeric).Value=9999999999.99;
cmd.Parameters.Add("@FNumeric_18_0",OleDbType.Numeric).Value=999999999999999999;
cmd.Parameters.Add("@FNumeric_18_2",OleDbType.Numeric).Value=999999999999999999.99;
cmd.Parameters.Add("@FMoney",OleDbType.Currency).Value=922337203685477.5807;
SPResult=cmd.Parameters.Add("@FDecimal_4_0_out",OleDbType.Numeric);
SPResult.Direction=ParameterDirection.Output;
SPResult=cmd.Parameters.Add("@FDecimal_4_2_out",OleDbType.Numeric);
SPResult.Direction=ParameterDirection.Output;
SPResult=cmd.Parameters.Add("@FDecimal_5_0_out",OleDbType.Numeric);
SPResult.Direction=ParameterDirection.Output;
SPResult=cmd.Parameters.Add("@FDecimal_5_2_out",OleDbType.Numeric);
SPResult.Direction=ParameterDirection.Output;
SPResult=cmd.Parameters.Add("@FDecimal_8_0_out",OleDbType.Numeric);
SPResult.Direction=ParameterDirection.Output;
SPResult=cmd.Parameters.Add("@FDecimal_8_2_out",OleDbType.Numeric);
SPResult.Direction=ParameterDirection.Output;
SPResult=cmd.Parameters.Add("@FDecimal_9_0_out",OleDbType.Numeric);
SPResult.Direction=ParameterDirection.Output;
SPResult=cmd.Parameters.Add("@FDecimal_9_2_out",OleDbType.Numeric);
SPResult.Direction=ParameterDirection.Output;
SPResult=cmd.Parameters.Add("@FDecimal_10_0_out",OleDbType.Numeric);
SPResult.Direction=ParameterDirection.Output;
SPResult=cmd.Parameters.Add("@FDecimal_10_2_out",OleDbType.Numeric);
SPResult.Direction=ParameterDirection.Output;
SPResult=cmd.Parameters.Add("@FDecimal_18_0_out",OleDbType.Numeric);
SPResult.Direction=ParameterDirection.Output;
SPResult=cmd.Parameters.Add("@FDecimal_18_2_out",OleDbType.Numeric);
SPResult.Direction=ParameterDirection.Output;
SPResult=cmd.Parameters.Add("@FNumeric_4_0_out",OleDbType.Numeric);
SPResult.Direction=ParameterDirection.Output;
SPResult=cmd.Parameters.Add("@FNumeric_4_2_out",OleDbType.Numeric);
SPResult.Direction=ParameterDirection.Output;
SPResult=cmd.Parameters.Add("@FNumeric_5_0_out",OleDbType.Numeric);
SPResult.Direction=ParameterDirection.Output;
SPResult=cmd.Parameters.Add("@FNumeric_5_2_out",OleDbType.Numeric);
SPResult.Direction=ParameterDirection.Output;
SPResult=cmd.Parameters.Add("@FNumeric_8_0_out",OleDbType.Numeric);
SPResult.Direction=ParameterDirection.Output;
SPResult=cmd.Parameters.Add("@FNumeric_8_2_out",OleDbType.Numeric);
SPResult.Direction=ParameterDirection.Output;
SPResult=cmd.Parameters.Add("@FNumeric_9_0_out",OleDbType.Numeric);
SPResult.Direction=ParameterDirection.Output;
SPResult=cmd.Parameters.Add("@FNumeric_9_2_out",OleDbType.Numeric);
SPResult.Direction=ParameterDirection.Output;
SPResult=cmd.Parameters.Add("@FNumeric_10_0_out",OleDbType.Numeric);
SPResult.Direction=ParameterDirection.Output;
SPResult=cmd.Parameters.Add("@FNumeric_10_2_out",OleDbType.Numeric);
SPResult.Direction=ParameterDirection.Output;
SPResult=cmd.Parameters.Add("@FNumeric_18_0_out",OleDbType.Numeric);
SPResult.Direction=ParameterDirection.Output;
SPResult=cmd.Parameters.Add("@FNumeric_18_2_out",OleDbType.Numeric);
SPResult.Direction=ParameterDirection.Output;
SPResult=cmd.Parameters.Add("@FMoney_out",OleDbType.Currency);
SPResult.Direction=ParameterDirection.Output;

cmd.ExecuteNonQuery();
имею... ;)
OverflowException.Message

Value was either too large or too small for a Currency.

хотя
refman1.pdf

money Денежные величины в диапазоне от +922 337 203 685 477,5807 до -922 337 203 685 477,5808

фиг с тобой, золотая рыбка, - меняю
cmd.Parameters.Add("@FMoney",OleDbType.Currency).Value=999.9999;
имею... ;)
OleDbException.Message

[Native Error code: 247]
[DataDirect ADO Sybase Provider] Arithmetic overflow during implicit conversion of NUMERIC value '9999.99' to a DECIMAL field .
[Native Error code: 247]
[DataDirect ADO Sybase Provider] Arithmetic overflow during implicit conversion of NUMERIC value '99999.99' to a DECIMAL field .
[Native Error code: 247]
[DataDirect ADO Sybase Provider] Arithmetic overflow during implicit conversion of NUMERIC value '99999999.99' to a DECIMAL field .
[Native Error code: 247]
[DataDirect ADO Sybase Provider] Arithmetic overflow during implicit conversion of NUMERIC value '999999999.99' to a DECIMAL field .
[Native Error code: 247]
[DataDirect ADO Sybase Provider] Arithmetic overflow during implicit conversion of NUMERIC value '9999999999.99' to a DECIMAL field .
[Native Error code: 247]
[DataDirect ADO Sybase Provider] Arithmetic overflow during implicit conversion of NUMERIC value '1000000000000000000' to a DECIMAL field .
[Native Error code: 247]
[DataDirect ADO Sybase Provider] Arithmetic overflow during implicit conversion of NUMERIC value '9999.99' to a NUMERIC field .
[Native Error code: 247]
[DataDirect ADO Sybase Provider] Arithmetic overflow during implicit conversion of NUMERIC value '99999.99' to a NUMERIC field .
[Native Error code: 247]
[DataDirect ADO Sybase Provider] Arithmetic overflow during implicit conversion of NUMERIC value '99999999.99' to a NUMERIC field .
[Native Error code: 247]
[DataDirect ADO Sybase Provider] Arithmetic overflow during implicit conversion of NUMERIC value '999999999.99' to a NUMERIC field .
[Native Error code: 247]
[DataDirect ADO Sybase Provider] Arithmetic overflow during implicit conversion of NUMERIC value '9999999999.99' to a NUMERIC field .
[Native Error code: 247]
[DataDirect ADO Sybase Provider] Arithmetic overflow during implicit conversion of NUMERIC value '1000000000000000000' to a NUMERIC field .

Сакраментальный вопрос: Кто виноватЪ? Что делатЪ?

_________________
"Helo, word!" - 17 errors 56 warnings
Ex_Soft
Дата: 23.03.2005 15:28:34
сорри... забыл-недоглядел :(
numeric(4,2) - это ж 99.99, а не 9999.99

money тоже заборол:
cmd.Parameters.Add("@FMoney",OleDbType.Currency).Value=922337203685477.5807m; // т.е. decimal ната

осталось тока записать данные с десятичной частью:
на
cmd.Parameters.Add("@FNumeric_4_2",OleDbType.Numeric).Value=99.99;
OleDbException.Message

[Native Error code: 241]
[DataDirect ADO Sybase Provider] Scale error during implicit conversion of NUMERIC value '99.99' to a NUMERIC field.

целое - пишет, а фот 99.99 - не хочет...
типами баловался (пробовал OleDbType.Decimal), 99.99 к decimal'у приводил - шо мертвому припарки... Ж8-/
вагон бубнов пАлАмАл Картинка с другого сайта.
Как же, все-таки, записать-передать десятичное (валидное по типу) значение в numeric(precision, scale) (decimal(precision, scale))Картинка с другого сайта.Картинка с другого сайта.Картинка с другого сайта.Картинка с другого сайта.Картинка с другого сайта.Картинка с другого сайта.
_________________
"Helo, word!" - 17 errors 56 warnings
Ex_Soft
Дата: 23.03.2005 16:14:59
Таки заборол:

SPResult=cmd.Parameters.Add("@FNumeric_4_2",OleDbType.Numeric);
SPResult.Precision=4;
SPResult.Scale=2;
SPResult.Value=99.99;
SPResult=cmd.Parameters.Add("@FNumeric_4_2_out",OleDbType.Numeric);
SPResult.Precision=4;
SPResult.Scale=2;
SPResult.Direction=ParameterDirection.Output;

но это ж изврат!!! Ж8-/ Картинка с другого сайта.Картинка с другого сайта. а если структура БД поменяется???

"...Вот уроды..." х/ф "Брат-2" (c)
_________________
"Helo, word!" - 17 errors 56 warnings
Alexander Kadirov
Дата: 30.03.2005 18:41:30
А ты структуру базы бери из базы:
SELECT * FROM INFORMATION_SCHEMA.COLUMNS C
JOIN INFORMATION_SCHEMA.TABLES T ON T.TABLE_NAME=C.TABLE_NAME
ну и т.д.
__guest
Дата: 30.03.2005 18:46:58
2 Alexander Kadirov

Можно поподробнее, как для SyBase ASE 12.5 это будет выглядеть ???
Alexander Kadirov
Дата: 30.03.2005 20:43:29
__guest
2 Alexander Kadirov

Можно поподробнее, как для SyBase ASE 12.5 это будет выглядеть ???


А вот для sybase, хрен его знает. Не изучал.
__guest
Дата: 30.03.2005 21:55:00
Жаль :(
Вопрос (и весь тред) был именно по SyBase ASE 12.5
---------------------
Как-то странно - отвечу что знаю, а не о чём спрашивают...
Ex_Soft
Дата: 11.04.2005 18:41:51
Поскольку все выполняется посредством ХП, то все решилось очень красиво посредством OleDbCommandBuilder.DeriveParameters - возвращается все, что необходимо... Остается только заполнить Parameters.Value для тех, у кого ParameterDirection.Input...
_________________
"Helo, word!" - 17 errors 56 warnings
Ex_Soft
Дата: 24.04.2005 01:30:43
Вторая часть марлезонского балета Картинка с другого сайта.Картинка с другого сайта.
create procedure sp_TestTypes_Decimal_10_6  
  @FDecimal_10_6 decimal(10,6),  
  @FDecimal_10_6_out decimal(10,6) output  
as   
begin  
  declare  
    @RetVal int  
  
  select @FDecimal_10_6_out = @FDecimal_10_6  
  
  select @RetVal=65535   
   
  return(@RetVal)  
end

create procedure sp_TestTypes_Numeric_10_6  
  @FNumeric_10_6 numeric(10,6),  
  @FNumeric_10_6_out numeric(10,6) output  
as   
begin  
  declare  
    @RetVal int  
  
  select @FNumeric_10_6_out =@FNumeric_10_6  
  
  select @RetVal=65535   
   
  return(@RetVal)  
end
double
  tmpDoubleIn,
  tmpDoubleOut;

decimal
  tmpDecimalIn,
  tmpDecimalOut;

int
  ReturnValue;

tmpDoubleIn=13;
SQLText="sp_TestTypes_Decimal_10_6";
cmd=cn.CreateCommand();
cmd.CommandType=CommandType.StoredProcedure;
cmd.CommandText=SQLText;
OleDbCommandBuilder.DeriveParameters(cmd);
cmd.Parameters["FDecimal_10_6"].Value=tmpDoubleIn;
cmd.ExecuteNonQuery();
ReturnValue=Convert.ToInt32(cmd.Parameters["RETURN_VALUE"].Value);
if(ReturnValue==65535)
{
   tmpDoubleOut=Convert.ToDouble(cmd.Parameters["FDecimal_10_6_out"].Value);
   if(Math.Abs(tmpDoubleIn-tmpDoubleOut)>Double.Epsilon)
   {
      Console.WriteLine("In != Out");
   }
}

SQLText="sp_TestTypes_Numeric_10_6";
cmd.CommandText=SQLText;
OleDbCommandBuilder.DeriveParameters(cmd);
cmd.Parameters["FNumeric_10_6"].Value=tmpDoubleIn;
cmd.ExecuteNonQuery();
ReturnValue=Convert.ToInt32(cmd.Parameters["RETURN_VALUE"].Value);
if(ReturnValue==65535)
{
   tmpDoubleOut=Convert.ToDouble(cmd.Parameters["FNumeric_10_6_out"].Value);
   if(Math.Abs(tmpDoubleIn-tmpDoubleOut)>Double.Epsilon)
   {
      Console.WriteLine("In != Out");
   }
}

tmpDecimalIn=13m;
SQLText="sp_TestTypes_Decimal_10_6";
cmd.CommandText=SQLText;
OleDbCommandBuilder.DeriveParameters(cmd);
cmd.Parameters["FDecimal_10_6"].Value=tmpDecimalIn;
cmd.ExecuteNonQuery();
ReturnValue=Convert.ToInt32(cmd.Parameters["RETURN_VALUE"].Value);
if(ReturnValue==65535)
{
   tmpDecimalOut=Convert.ToDecimal(cmd.Parameters["FDecimal_10_6_out"].Value);
   if(tmpDecimalIn!=tmpDecimalOut)
   {
      Console.WriteLine("In != Out");
   }
}

SQLText="sp_TestTypes_Numeric_10_6";
cmd.CommandText=SQLText;
OleDbCommandBuilder.DeriveParameters(cmd);
cmd.Parameters["FNumeric_10_6"].Value=tmpDecimalIn;
cmd.ExecuteNonQuery();
ReturnValue=Convert.ToInt32(cmd.Parameters["RETURN_VALUE"].Value);
if(ReturnValue==65535)
{
   tmpDecimalOut=Convert.ToDecimal(cmd.Parameters["FNumeric_10_6_out"].Value);
   if(tmpDecimalIn!=tmpDecimalOut)
   {
      Console.WriteLine("In != Out");
   }
}

передаю, как видите 13, а получаю взад 0.000013 Картинка с другого сайта. (как для double, так и для decimal). Каких @#$% ему еще не хватает? Что еще ната покрутить-подкрутить?

_________________
"Helo, word!" - 17 errors 56 warnings