473,394 Members | 1,759 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,394 software developers and data experts.

Bit Datatype

I created a table with a bit datatype column.
I created this column as "do not allow null" and default value of 0

Now when I go into the Database explorer, right click on the table and click
on "show table data",
to manually add some of my own data into it. How do I actaully type in a
value on the bit field?

The only thing that is saving me is that the default value is there. But I
cant seem to type in a value,
either 0, 1 True / False Yes No .

It keeps giving me the same error,
Invalid Value for cell ( row 2, column 6 )

The changed value in this cell was not recognized as valid.
..Net Framework data Type: Boolean
Error Message: String was not recognized as a valid boolean.
Type a value appropriate for the data type or press ESC t ocancel the
change.

I cant quite figure out how to type in a value here.
I can make a form with a datagrid - then I have a checkbox so I can enter
data that way. But its annoying me I cant figure out how to do this here.

Thanks

Miro
Jul 5 '07 #1
4 9502
Hi Miro -

True and False as values work on my end. Really, the values are stored
as -1 and 0 respectively.

Try putting in some data into all the other columns first (at least,
any that can't be null and don't have a default value). Then refresh
the table, and see how your interface is reporting the False value
that should be inserted on the DB side. After that, you should be able
to determine what to use for True (whatever the syntactic antonym is).

By the way, what are you using for a database? MS SQL Server 2005?

Cheers,

-Mark

Jul 5 '07 #2
Miro wrote:
I created a table with a bit datatype column.
I created this column as "do not allow null" and default value of 0
What database are you using?

The BIT data type according to the SQL92 standard is a string type, but
most databases implement it differently, like a numeric value or an
enumerated value.
Now when I go into the Database explorer, right click on the table and click
What database explorer are you using?
on "show table data",
to manually add some of my own data into it. How do I actaully type in a
value on the bit field?

The only thing that is saving me is that the default value is there. But I
cant seem to type in a value,
either 0, 1 True / False Yes No .

It keeps giving me the same error,
Invalid Value for cell ( row 2, column 6 )

The changed value in this cell was not recognized as valid.
.Net Framework data Type: Boolean
Error Message: String was not recognized as a valid boolean.
Type a value appropriate for the data type or press ESC t ocancel the
change.

I cant quite figure out how to type in a value here.
I can make a form with a datagrid - then I have a checkbox so I can enter
data that way. But its annoying me I cant figure out how to do this here.

Thanks

Miro


--
Göran Andersson
_____
http://www.guffa.com
Jul 5 '07 #3
Its SQL Express 2005

Ok - at least now I know I wasnt going crazy and "True" - "False" does work.

I deleted the table - re-created it without any joins and it worked.

I suspect I know what I did. - all user error and i should have rtfs when i
did a relationship.
I have another table called Login with a key LoginID - no nulls

here is a notes table so the keys are
NoteID - no nulls
LoginID - allow nulls here

I am suspecting the error was not actually an error on the boolean/bit field
but an error wth a wrong relationship.
It looks like the error is with the Bit field - but the bit field is my last
field in my whole table.

The only way I can re-create the error is doing a stupid relationship to
LoginID with NotID instead of Note-LoginID.
When you get to the last field ( in this case the bool field ) it errors
out -but not because of the field - because it cant join up the tables.

Thanks for your help.
-Super hard googling for key words like "bit" / "boolean" / "yes" / "no"
"VB.net" "datatype"

And back to learning...

Miro

"Mark S. Milley, MCSD (BinarySwitch)" <ma*********@binaryswitch.comwrote
in message news:11**********************@k79g2000hse.googlegr oups.com...
Hi Miro -

True and False as values work on my end. Really, the values are stored
as -1 and 0 respectively.

Try putting in some data into all the other columns first (at least,
any that can't be null and don't have a default value). Then refresh
the table, and see how your interface is reporting the False value
that should be inserted on the DB side. After that, you should be able
to determine what to use for True (whatever the syntactic antonym is).

By the way, what are you using for a database? MS SQL Server 2005?

Cheers,

-Mark

Jul 5 '07 #4
Miro,

The normal values for a bit type in SQL are, at least by the last two
managers for i,t forever 0 and 1.

Cor

"Miro" <mi******@golden.netschreef in bericht
news:uP**************@TK2MSFTNGP04.phx.gbl...
Its SQL Express 2005

Ok - at least now I know I wasnt going crazy and "True" - "False" does
work.

I deleted the table - re-created it without any joins and it worked.

I suspect I know what I did. - all user error and i should have rtfs when
i did a relationship.
I have another table called Login with a key LoginID - no nulls

here is a notes table so the keys are
NoteID - no nulls
LoginID - allow nulls here

I am suspecting the error was not actually an error on the boolean/bit
field but an error wth a wrong relationship.
It looks like the error is with the Bit field - but the bit field is my
last field in my whole table.

The only way I can re-create the error is doing a stupid relationship to
LoginID with NotID instead of Note-LoginID.
When you get to the last field ( in this case the bool field ) it errors
out -but not because of the field - because it cant join up the tables.

Thanks for your help.
-Super hard googling for key words like "bit" / "boolean" / "yes" / "no"
"VB.net" "datatype"

And back to learning...

Miro

"Mark S. Milley, MCSD (BinarySwitch)" <ma*********@binaryswitch.comwrote
in message news:11**********************@k79g2000hse.googlegr oups.com...
>Hi Miro -

True and False as values work on my end. Really, the values are stored
as -1 and 0 respectively.

Try putting in some data into all the other columns first (at least,
any that can't be null and don't have a default value). Then refresh
the table, and see how your interface is reporting the False value
that should be inserted on the DB side. After that, you should be able
to determine what to use for True (whatever the syntactic antonym is).

By the way, what are you using for a database? MS SQL Server 2005?

Cheers,

-Mark


Jul 5 '07 #5

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

Similar topics

14
by: Sanjay Minni | last post by:
What is the datatype to be used for Primary Key columns for most optimised access given that - There will be a single column primary key only - The values will only be integers (but as...
1
by: thepercival | last post by:
Hello, I have a stored procedure and the return data type is number(16) as you can see. but I get it back in the code as a var_numeric and then the precision depends on the value of the...
8
by: Eternally | last post by:
Hi folks, I've got a program which has a function which uses templates to accept parameters of any type. Works well, but there's one certain datatype which I want to special case and do an...
0
by: SoYouKnowBrig | last post by:
Hi All, I am using Microsoft.ApplicationBlocks.Cache.CacheManager to persist a System.Data.Dataset object. This Dataset object has a DataTable that is created from an existing DataTable using...
10
by: andrewcw | last post by:
I read in a earlier post that I can get the column of a grid to sort by datetime if the column type was set as Date I deserialize my XML and one attribute of the XSD has type as dateTime but upon...
3
by: Sri | last post by:
In VB, to know the field type of a column stored in a recordset the command I use is If rsQuery.Fields(k).Type = adCurrency Then How will I achieve the same in ASP.net. I could not find a...
1
by: Bryan | last post by:
I have a class called "Prop". I want that class to have a property called "DataType" where the user can select and store a datatype. How can I store a DataType value in a class property. how...
4
by: Orchid | last post by:
How can I change a Date datatype to a Number datatype? For example, I want a date 10/31/2006 to show 1031 as Number datatype. But I don't want it becomes 39021. What formula should I use? ...
0
by: graju80 | last post by:
I am kind of new to Db2... Question: What are the rules that DB2 uses to determine the right datatype for a particular column for on-the-fly SQL generation? For example...
11
by: BD | last post by:
Hi, all. I'm running 8.2 on Windows. This is a development platform for a project whose production environment is running on a mainframe. I believe that the RI compilation process is not...
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:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.