473,382 Members | 1,329 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

Using Boolean Values

Let's say I have a SPROC that returns a boolean value:
PROCEDURE [DBO].[StoreHasOwnMasterPageBool]
(
@StoreID int
)
AS
SET NOCOUNT ON;
SELECT HasOwnMasterPage
FROM dbo.Stores
WHERE (StoreID = @StoreID)

Where the Column HasOwnMasterPage is of type Boolean in SQL Server 2005.

In my XSD file, StorePresentationDS.xsd, I have a TableAdapter called
StoreHasOwnMasterPageBoolTableAdapter, and off this I have a Query (a
GetMethodName) called GetBoolStoreMasterPage. It works.

In my Business Layer, I would like to retrieve a value from that dataset, to
then pass to a code-behind of an aspx page.
I guess that I could code something like this:
Public Function HasOwnMasterPage(ByVal StoreID As Integer) As Boolean

Dim StoreMasterPageBool As New
StorePresentationDSTableAdapters.StoreHasOwnMaster PageBoolTableAdapter

If StoreMasterPageBool.ToString = "True" Then

Return True

Else

Return False

End If

End Function

----
But is there something better? What is it best way to treat a boolean result
of a Stored Procedure? Somehow going from Bool to string looks wastful.

TIA, (I love this stuff, but wish I knew more)

Paul

Apr 20 '06 #1
0 881

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Random Person | last post by:
Does anyone know how to use VBA to relink tables between two MS Access databases? We have two databases, one with VBA code and the other with data tables. The tables are referenced by linked...
11
by: Grasshopper | last post by:
Hi, I am automating Access reports to PDF using PDF Writer 6.0. I've created a DTS package to run the reports and schedule a job to run this DTS package. If I PC Anywhere into the server on...
1
by: Daveyk0 | last post by:
Hello there, I have a front end database that I have recently made very many changes to to allow off-line use. I keep copies of the databases on my hard drive and link to them rather than the...
0
by: Kenneth P | last post by:
Hi, In MySql db doc ch 11 TINYINT A very small integer. The signed range is -128 to 127. The unsigned range is 0 to 255. BIT BOOL BOOLEAN
0
by: Robert Love | last post by:
I am trying to save some boolean values from checkboxes using isolated storage. I am able to do strings and integers without a problem but I can't work out how to save boolean values without seeing...
0
by: ECathell | last post by:
Ok this may be a silly question...but here goes... I need to extend the boolean type. the reason for this is I have a base collection that has boolean properties. Then my inherited class has...
6
by: ransoma22 | last post by:
I developing an application that receive SMS from a connected GSM handphone, e.g Siemens M55, Nokia 6230,etc through the data cable. The application(VB.NET) will receive the SMS automatically,...
10
by: dba123 | last post by:
Why am I getting this error for Budget? Error: An exception of type 'System.FormatException' occurred in mscorlib.dll but was not handled in user code Additional information: String was not...
19
by: tshad | last post by:
I have a value in my sql table set to tinyint (can't set to bit). I am trying to move it into a boolean field in my program and have tried: isTrue = (int)dbReader and isTrue =...
4
by: Marc | last post by:
Hi, I don't get it I cannot get this to work, can somebody give me a hint Table1 contains a field Id which is a GUID as primary key and DATA a string, I want to insert a new row but it does not...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.