P
P@rick
Hi all,
I want to call a stored procedure containing a decimal parameter:
SqlCommand dbCommand = new SqlCommand("myStoredProcedure", myConnection);
dbCommand.CommandType = CommandType.StoredProcedure;
SqlParameter parmTOHighShort = dbCommand.Parameters.Add("@dTOHighShort", SqlDbType.Decimal, 9);
parmTOHighShort.Direction = ParameterDirection.Input;
parmTOHighShort.Value = dataObject.TOHighShort;
try
{
dbCommand.ExecuteNonQuery();
}
catch (Exception e)
{
int i = 0;
}
in the stored procedure this parameter is specified as follows:
CREATE PROCEDURE dbo.[myStoredProcedure]( @dTOHighShort AS DECIMAL (12,9) )
AS
.....
this does not work because the SqlDBType.Decimal do not specify any precision, but the T-Sql data type does!
Do any one know how to solve this problem ?
Regards,
P@rick
I want to call a stored procedure containing a decimal parameter:
SqlCommand dbCommand = new SqlCommand("myStoredProcedure", myConnection);
dbCommand.CommandType = CommandType.StoredProcedure;
SqlParameter parmTOHighShort = dbCommand.Parameters.Add("@dTOHighShort", SqlDbType.Decimal, 9);
parmTOHighShort.Direction = ParameterDirection.Input;
parmTOHighShort.Value = dataObject.TOHighShort;
try
{
dbCommand.ExecuteNonQuery();
}
catch (Exception e)
{
int i = 0;
}
in the stored procedure this parameter is specified as follows:
CREATE PROCEDURE dbo.[myStoredProcedure]( @dTOHighShort AS DECIMAL (12,9) )
AS
.....
this does not work because the SqlDBType.Decimal do not specify any precision, but the T-Sql data type does!
Do any one know how to solve this problem ?
Regards,
P@rick