Click here to Skip to main content
15,889,651 members
Home / Discussions / Database
   

Database

 
GeneralRe: Packaging a SQL Server database for installation as part of a custom application Pin
Dinuj Nath7-Oct-05 22:50
Dinuj Nath7-Oct-05 22:50 
QuestionConnect to SQL on same machine! help Pin
darXstar30-Sep-05 2:48
darXstar30-Sep-05 2:48 
AnswerRe: Connect to SQL on same machine! help Pin
Colin Angus Mackay30-Sep-05 12:13
Colin Angus Mackay30-Sep-05 12:13 
GeneralRe: Connect to SQL on same machine! help Pin
darXstar3-Oct-05 5:39
darXstar3-Oct-05 5:39 
QuestionSELECTING COLLATION WHEN INSTALLING MSDE. Pin
Bigfootguy29-Sep-05 20:28
Bigfootguy29-Sep-05 20:28 
AnswerRe: SELECTING COLLATION WHEN INSTALLING MSDE. Pin
darXstar30-Sep-05 2:37
darXstar30-Sep-05 2:37 
QuestionTo Bitmask or Not Pin
xsoftdev229-Sep-05 19:35
xsoftdev229-Sep-05 19:35 
AnswerRe: To Bitmask or Not Pin
Russell Jones3-Oct-05 5:59
Russell Jones3-Oct-05 5:59 
Let's say you've just got 2 types of car: Honda, Toyota

if i've driven a honda i have the value 10 (2)
if i've driven a toyota i have the value 01 (1)
if i've driven both then i have the value 11 (3)

use the same system for the cars your checking for.

Example 1

Uservalue = 11(3) (driven both)
Carvalue = 01(1) (just a toyota)

If we use a bitwise AND ( check each digit in turn and iff they are both 1 place a 1 in the corresponding digit of the result) we get the value 01. Comparing this to the carvalue we find that the user has indeed driven a toyota.

IF uservalue & Carvalue = Carvalue
BEGIN
PRINT 'Has Driven a toyota'
END

This sytem extends to as many bytes as the biggest int available to you.

Example 2:

Uservalue = 110110110110110110
CarValue = 100110100010110010
Result = 100110100010110010 (The user has driven all the cars specified in CarValue)


To Create the bitmasks use a logical OR, or just add the numbers together

CarValue = Toyota | Honda is equivalent to Carvalue = Toyota + Honda using bitmasks, but if you use the OR sysntax for complicated expressions you will never be able to add the same car twice which would cause problems.

HTH

Russ


-- modified at 11:59 Monday 3rd October, 2005
QuestionOracle Help Needed - ComboBox data binding Pin
Glenn E. Lanier II29-Sep-05 9:30
Glenn E. Lanier II29-Sep-05 9:30 
AnswerRe: Oracle Help Needed - ComboBox data binding Pin
Guillermo Rivero3-Oct-05 11:40
Guillermo Rivero3-Oct-05 11:40 
AnswerRe: Oracle Help Needed - ComboBox data binding Pin
Glenn E. Lanier II2-Mar-06 8:33
Glenn E. Lanier II2-Mar-06 8:33 
QuestionWhere should I store my connection string? Pin
Haim Yulzari28-Sep-05 22:24
Haim Yulzari28-Sep-05 22:24 
AnswerRe: Where should I store my connection string? Pin
Anonymous29-Sep-05 7:41
Anonymous29-Sep-05 7:41 
AnswerRe: Where should I store my connection string? Pin
Luis Alonso Ramos29-Sep-05 17:13
Luis Alonso Ramos29-Sep-05 17:13 
AnswerRe: Where should I store my connection string? Pin
-Dr_X-2-Oct-05 14:42
-Dr_X-2-Oct-05 14:42 
QuestionRetrieve & update data against remote database Pin
nmhuy28-Sep-05 8:15
nmhuy28-Sep-05 8:15 
AnswerRe: Retrieve & update data against remote database Pin
enjoycrack28-Sep-05 20:01
enjoycrack28-Sep-05 20:01 
GeneralRe: Retrieve & update data against remote database Pin
nmhuy29-Sep-05 7:22
nmhuy29-Sep-05 7:22 
QuestionHelp in SQL Stored proc Pin
satishrg28-Sep-05 7:00
satishrg28-Sep-05 7:00 
AnswerRe: Help in SQL Stored proc Pin
enjoycrack28-Sep-05 20:08
enjoycrack28-Sep-05 20:08 
QuestionADO .net --> Excel Pin
Braulio Díez27-Sep-05 23:02
sussBraulio Díez27-Sep-05 23:02 
AnswerRe: ADO .net --> Excel Pin
Braulio Dez27-Sep-05 23:30
Braulio Dez27-Sep-05 23:30 
Questionget update status of each row Pin
manasrahfantom27-Sep-05 22:13
manasrahfantom27-Sep-05 22:13 
Questionautomatically Run an Sql statement Pin
achrafus27-Sep-05 9:18
achrafus27-Sep-05 9:18 
AnswerRe: automatically Run an Sql statement Pin
Colin Angus Mackay27-Sep-05 9:49
Colin Angus Mackay27-Sep-05 9:49 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.