473,320 Members | 2,112 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,320 software developers and data experts.

Checkboxfield Storing 1 instead of -1 for True

(ASP.net 2.0)
I am using a Gridview control that is bound to a table in my SQL
database. For some reason, when the Checkbox is clicked, it stores a 1
(Positive 1) in the bound field instead of a -1 (Negative 1). Any
ideas what's going on?

Jan 17 '06 #1
3 1238
because it's working properly .

0/1 = false/true

although any non-zero value can be used as true, the normal convention is to use 1

<mi******@gmail.com> wrote in message news:11**********************@g47g2000cwa.googlegr oups.com...
(ASP.net 2.0)
I am using a Gridview control that is bound to a table in my SQL
database. For some reason, when the Checkbox is clicked, it stores a 1
(Positive 1) in the bound field instead of a -1 (Negative 1). Any
ideas what's going on?

Jan 17 '06 #2
I thought it was -1.
Set a breakpoint in your VB.net code and type the following into a
command/immediate window:
? true= 1 (comes back with False)
? true= -1 (comes back with True)

No?

Jan 17 '06 #3
here's an info page of some nuances.

http://visualbasic.about.com/library.../aa032903c.htm

google for more on the subject if needed
<mi******@gmail.com> wrote in message news:11**********************@g47g2000cwa.googlegr oups.com...
I thought it was -1.
Set a breakpoint in your VB.net code and type the following into a
command/immediate window:
? true= 1 (comes back with False)
? true= -1 (comes back with True)

No?

Jan 17 '06 #4

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

Similar topics

3
by: Brad | last post by:
I am programatically trying to add a checkBox column to a gridView. This is what I have to do it (VB): Dim cbCol As New CheckBoxField cbCol.Text = "Enter this event" gvEvents.Columns.Add(cbCol)...
2
by: hazz | last post by:
Given the update query UPDATE Columns SET Include_in_Report = @Include_in_Report WHERE (ID = @Original_ID); Include_In_Report is a bit field in the table, represented as a...
1
by: graphicsxp | last post by:
Hi, I have a checkboxfield in my gridview: <asp:CheckBoxField DataField="Analysed" HeaderText ="Analysed"> <ItemStyle width="20px" /> </asp:CheckBoxField> How can I reference the field from...
0
by: dwg1011 | last post by:
I have a detailview with several fields ending with the CheckBoxField shown below: <asp:CheckBoxField DataField="aruExtraFields" HeaderText="Extra Fields?" ReadOnly="false"...
1
by: spitapps | last post by:
I have a gridview declaratively added to my webform. This gridview displays data from a stored procedure returned as a dataset. Once the dataset has been modified slightly i bind it to my...
0
by: Gustavo Ringel | last post by:
Hi, I'm trying to get the checked/unchecked of a Gridview CheckBoxField in code. I tried to cast the row cell to a CheckBoxField and it doesn't compiles. I'm also able to get the Text of the...
5
by: per9000 | last post by:
Hi all, I want to create an encryption program and started thinking about not storing sensitive information in the memory since I guess someone might steal my computer an scan my memory. So I...
0
by: Jason Huang | last post by:
Hi, How do I bind data to a GridView in my C#.Net 2.0? Given that in the GridView1 I have 3 BoundFields and 1 CheckBoxField. I can bind the DataSet to the 3 BoundFields if there's no...
0
by: Slickuser | last post by:
I want to implement a GridView that displays all records in the database & which contain CheckBoxField (true,false). Whenever this form is displayed, the user can be able to change the status of...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
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: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

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.