Home
Search
 
What's New
Index
Books
Links
Q & A
Newsletter
Banners
 
Feedback
Tip Jar
 
C# Helper...
 
XML RSS Feed
Follow VBHelper on Twitter
 
 
MSDN Visual Basic Community
 
 
 
 
 
TitleDataForm Wizard has trouble with the bit data type
KeywordsNET, DataForm Wizard, bit data type, CurrencyManager, BindingContext, add new records
CategoriesBug Alerts
 
Fred Gravel reported this bug.

I created a skeleton Data Form using the Data Form wizard in VB.Net. The data loads just fine, but the problem is with the add button.

It seems like the dataset creates a new record when the button is clicked, but doesn't move to it. The form is still set to the first record in the dataset. I have tried just about everything I can think of including the following, immediatly after the "addnew" command in the "addbutton_click" event:

 
dim x as integer = Me.BindingContext(objdsWorkOrder, _
    "WorkOrders").Count
Me.BindingContext(objdsWorkOrder, "WorkOrders").Position = _
     x
 
I have a SQL table called "WorkOrders" set up with the following fields:

    nItemID varchar 12 allow nulls=yes
    stFileName nvarchar 50 allow nulls=no
    ...
    nChargeStatus bit 1 allow nulls=no
    ...

I just can't get the dataform to set up for a new record entry!!!!!! Any Ideas ???

What's frustrating is, that, I've another form created the same way with a different table that works great. I can't see any differences other than table & field names


[Fortunately Fred solved his own problem with the help of Pat Carden.]

It turns out that either the dataset or the dataform wizard has a problem with the "BIT" type. One of the fields in my table was set to this and when I changed it to "integer" type and re-built the dataform, it worked just fine.

Copyright © 1997-2010 Rocky Mountain Computer Consulting, Inc.   All rights reserved.
  Updated