?
Solved

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

Posted on 2007-10-17
2
Medium Priority
?
238 Views
Last Modified: 2007-10-17
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
0
Comment
Question by:Netlink2
2 Comments
 
LVL 53

Accepted Solution

by:
Dhaest earned 2000 total points
ID: 20098945
>> value should be true and the other should be false

Do you mean that you want a 1 (true) or 0 (false) ?
Can't you use a bool or bit-field (what database are you using) ?
0
 
LVL 1

Author Comment

by:Netlink2
ID: 20098996
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
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Why is this different from all of the other step by step guides?  Because I make a living as a DBA and not as a writer and I lived through this experience. Defining the name: When I talk to people they say different names on this subject stuff l…
What if you have to shut down the entire Citrix infrastructure for hardware maintenance, software upgrades or "the unknown"? I developed this plan for "the unknown" and hope that it helps you as well. This article explains how to properly shut down …
Via a live example, show how to shrink a transaction log file down to a reasonable size.
Viewers will learn how to use the SELECT statement in SQL to return specific rows and columns, with various degrees of sorting and limits in place.
Suggested Courses

621 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question