byte number = 1; add(number); // form .cs
public static int Add( byte? order)
{
arParams[0] = new SqlParameter("@number", (number.HasValue) ? ((object)number) : DBNull.Value);
// stored procedure call is made which takes paramaters,
}
Stored procedure looks like this
@number tinyint
AS
BEGIN
IF @number IS NOT NULL
BEGIN
UPDATE
table1
SET
number = number + 1
WHERE
id=13
END
INSERT INTO
table1
(
number
)
VALUES
(
number=@number
)
///////why i am getting this error can any one illustrate please and how do i solve this
The range of tinyint is 0-255.
You're attempting to put 256 into a datatype that doesn't know what 256 is.
int, bigint, smalltint and tinyint ranges.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With