Link to home
Start Free TrialLog in
Avatar of Netlink2
Netlink2

asked on

dataadapter saving tinyint or boolean data as 255 in table no matter if true or false

The following is the code.

Using db As New MyDataAdapter(
dim garage as boolean, carport as boolean
carport = true
garage = false
adId = CInt(db.InsertAd(garage, carport, membername))

which calls:

ALTER PROCEDURE InsertAd
(
      @garage tinyint,
      @carport tinyint,
      @logo ntext,
      @membername ntext
)
AS
DECLARE @Id int;
SET NOCOUNT OFF;
INSERT INTO MyTable
                      (garage,carport,membername)
VALUES     (@garage,@carport,@membername)
SET @Id = @@IDENTITY
SELECT  @Id  AS [Id]

The values in both @garage and      @carport are 255 despite the fact that one value should be true and the other should be false
ASKER CERTIFIED SOLUTION
Avatar of Dirk Haest
Dirk Haest
Flag of Belgium image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Netlink2
Netlink2

ASKER

Um, my bad, I was reading from a radio button and the value is 1 or 2 , not 0 or 1, but thanks for your help