PC Review


Reply
Thread Tools Rate Thread

Cannot addnew with Checkbox bound to bit column.

 
 
=?Utf-8?B?SmVmZiBHcnVuZHk=?=
Guest
Posts: n/a
 
      25th Oct 2004
Why does addnew fail when I have a checkbox bound to a sql bit column?

steps to recreate the problem:

1 - Create a table in sql with a varchar and a bit column.
2 - Add a couple of records to the table so you can see that the dataform is
actually working
3 - Use the DataFormWizard to create a form bound to that table (On the
'Choose Display Style' page of the wizard select the 'Single Record in
individual controls' raido button)
4 - Set Project Startup Object to the new dataform.
5 - Run project.
6 - Press the 'Load' button on the new dataform.
7 - Press the add button.

I am unable to add new records. the X of x counter indicates a new record
has benn added but I am unable to get to it using the nav buttons.

If I set the databindings-checked property of the checkbox to (none) i am
able to add a new record.
--
Jeff
 
Reply With Quote
 
 
 
 
Kevin Yu [MSFT]
Guest
Posts: n/a
 
      26th Oct 2004
Hi Jeff,

First of all, I would like to confirm my understanding of your issue. From
your description, I understand that when you have bounded a checkbox to bit
column, you cannot add a new record to the Dataset. If there is any
misunderstanding, please feel free to let me know.

As far as I know, this is a known issue. When the checkbox is bound to a
bit column and its default value is not set, the field value has to be
DBNull when a new row is added. However, the checked property knows nothing
about DBNull, so it fails. The workaround is to add a default value to the
bit column in either schema or code.

Here is a KB article for more information on this issue. HTH.

http://support.microsoft.com/default...B;EN-US;326440

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."

 
Reply With Quote
 
 
 
 
=?Utf-8?B?SmVmZiBHcnVuZHk=?=
Guest
Posts: n/a
 
      26th Oct 2004
That KB article addressed the problem.

"Kevin Yu [MSFT]" wrote:

> Hi Jeff,
>
> First of all, I would like to confirm my understanding of your issue. From
> your description, I understand that when you have bounded a checkbox to bit
> column, you cannot add a new record to the Dataset. If there is any
> misunderstanding, please feel free to let me know.
>
> As far as I know, this is a known issue. When the checkbox is bound to a
> bit column and its default value is not set, the field value has to be
> DBNull when a new row is added. However, the checked property knows nothing
> about DBNull, so it fails. The workaround is to add a default value to the
> bit column in either schema or code.
>
> Here is a KB article for more information on this issue. HTH.
>
> http://support.microsoft.com/default...B;EN-US;326440
>
> Kevin Yu
> =======
> "This posting is provided "AS IS" with no warranties, and confers no
> rights."
>
>

 
Reply With Quote
 
Kevin Yu [MSFT]
Guest
Posts: n/a
 
      27th Oct 2004
Hi Jeff,

Thanks for sharing your experience with all the people here. If you have
any questions, please feel free to post them in the community.

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
C# insertion of a record with CurrencyManager AddNew() method during the insertion of a father table record (with CurrencyManager AddNew() too) polocar Microsoft C# .NET 0 27th Sep 2006 06:51 PM
64 bit - Windows Liberty 64bit, Windows Limited Edition 64 Bit, Microsoft SQL Server 2000 Developer Edition 64 Bit, IBM DB2 64 bit - new ! vvcd AMD 64 Bit 0 17th Sep 2004 09:07 PM
64 bit - Windows Liberty 64bit, Windows Limited Edition 64 Bit, Microsoft SQL Server 2000 Developer Edition 64 Bit, IBM DB2 64 bit - new ! vvcd Processors 0 17th Sep 2004 09:01 PM
Master-Detail Datagrid -checkbox (once tick the checkbox, all the child checkbox is ticked) Agnes Microsoft VB .NET 0 16th Aug 2004 11:23 AM
BindingContext.AddNew method does not work if a DateTimePicker has been data bound Joshua Ellul Microsoft ADO .NET 6 19th Oct 2003 10:03 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 10:46 PM.