BLUNT Posted June 26, 2003 Posted June 26, 2003 I have built a form that is bound to a dataset. The form is not showing a grid. I have built this manualy and with the VS.Net wizzards with the same results. When I click on the Add button and it runs the code: me.bindingcontext(dataset,"Table Name").Addnew The new record is added to the dataset, the count of the data set increases, but I can not navigate to the new record. This was working and then it stopped which means I changed something and I can't figure out what I changed. Any and all help is appreciated. BLUNT Quote
Moderators Robby Posted June 26, 2003 Moderators Posted June 26, 2003 shouldn't you bind to the grid? (Instead of the Form) Quote Visit...Bassic Software
*Experts* jfackler Posted June 27, 2003 *Experts* Posted June 27, 2003 You add a new row to the dataset as in the example below. Dim NewRow As DataRow = dataset2.Tables("employees").NewRow NewRow("Name") = cmbEmployeeName.Text NewRow("Phone") = "Enter Employee Phone" NewRow("BeginningPTO") = 0 NewRow("DateHired") = Date.Now dataset2.Tables("Employees").Rows.Add(NewRow) Jon Quote
BLUNT Posted July 11, 2003 Author Posted July 11, 2003 Add New Fail Interesting debug process that lead me to getting it to work but still stumped. 1) The issue was with a CheckBox field linked to a Boolean field. In a data for (non-grid), it would add the record but not let you navigate to it. In a data-grid all worked well. 2) If I changed the field from a checkbox to a list box with True/False as the choices, the AddNew worked like a charm. I ran into this same issue later on in a Data Grid with a CheckBox field liked to a Boolean. The compile would work fine, but the execution would give an exectption error indicating that the data (Boolean) was not compatible with a CheckBox field! Any ideas on the cause of this is appreciated. Quote
loyal Posted November 26, 2003 Posted November 26, 2003 hi check this article Check box bugs Quote Gary Says: To be a good programmer, you must be good at debugging
BLUNT Posted November 26, 2003 Author Posted November 26, 2003 Thanks for the Link. At least I am not going nuts, there is a reason for the quirk! Quote
barski Posted October 8, 2004 Posted October 8, 2004 thanks so much for posting that article. You just saved me about $100 worth of spackle for holes I was about to put in the drywall. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.