TableAdapter Update fail - vb.net

I have a VB windows Form project that connects to several DataTables in an Access DB. On my form I have several textboxes, comboboxes and datetimepickers that are bound to those sources. With one table in particular when I try to update the tableadapter after editing one of the textboxes the update method fails. No exceptions are thrown, but the update method returns a zero value and the data is not updated. The update will work when just the comboboxes or datetimepickers are edited, but as soon as a textbox is edited also, update will not work.
Other DataTables within the project are set up in the same manner but are not having update issues. I can't figure out what about this one particular table is causing an issue. Can anyone give me any thoughts on where or what to troubleshoot?
Thanks!

try adding another textbox or other control pointed to the same source and see if you can get that one to update. Could be something funky with the control's settings that you're missing, and if you start over, it would be fine.

Related

VB.NET DataGridView Cell Editing

Edited / re-written due to jmcilhinney's comment...
I have a project which uses several DGVs bound to an Access db. The form designer show 3 data sets for some reason, even though the solution explorer shows only one and all the tables are shown in that one data set's designer.
I can edit the first DGV but not another on the same form, the first is filled with the following...
Me.PingMonitorPLC_IPsTableAdapter.Fill (Me.PingMonitorDataSet.PingMonitorPLC_IPs)
And the other is filled with the following code...
Me.ActiveAlarmsTableAdapter.Fill(Me.PingMonitorDataSet1.ActiveAlarms)
jmcilhinney's comment is that I must be doing something wrong, the form load event only runs the code listed above.
I dont know why I have 3 data sets listed on the form designer and I am too scared to go deleting things as I have lost an entire project before because I corrupted the designer by deleting controls etc.

Access Field Not Refreshing

To start, I am using Access 2003 and have a similar project that works correctly that I designed.
I am stumped as to why a particular field will not change dynamically like every other field until I "refresh".
Currently I have a task list that lists all items that need to be works. Containing a Status: New, Open, Closed; The account number, person who is working it and more.
The tasklist is just a form with a subform with a datasheet view that opens the task when you double click it. If a user opens a task, that task will be locked until they move on. If any information that is viewed in the task list is changed, it dynamically updates, all but the Status (which really is the most important) until the user manually refreshes it.
Does anyone know what I need to look for that would cause this? The Status is stored as an integer that joins with it's true value. I thought this may be the reason, however I have a similar tool I designed does not have this issue.
I've look into how they are joined, the code that changes this value, everything seems the same between the working and not working.
Any advice?
Thanks in advance.
edit any fields that are JOINED, do not seem to dynamically update until I hit refresh. However, the other database has this working. What am I missing that is different between them.
Solved.
I changed the object displaying the field from a textbox to a combobox, showed two columns with widths 0";1" and it works.

Is there an event which fires before a user enters a row into the datagridview in .net 3.5

I am trying to create a wrapper to replace the sheridan datagrid actvex control with a datagridview.
The sheridan datagrid control supports an event which fires just before the user is going to add a row to the grid called BeforeInsert.
Does anyone know of an equivalent event in the datagridview control or or some other code I could write which produces the same effect?
I'm having a look at all the events here, I don't see one for Adding or Inserting a row, just Added. Although there's one for Deleting and Deleted strangely enough. I won't pretend to know why. To your question, how exactly will users be adding rows? You could try playing around with the "AllowUserToAddRowsChanged" event and change that property programatically when the user wants to add a row.

Ms Access 2007 ComboBox

I am using Access for a quick and dirty (ADP) interface for an SQL (Express 2012) database so data entry can begin before the MVC web app interface is complete.
There is one field I want to be varchar, I would like this field to either allow the user to type in a value or select from a distinct list of values previously used in that field.
I have that part down, but the problem is when it happens, I have to refresh the recordset to see the new item in the list, so if they choose add a new record, then the last item added is not visible in the list.
So I can get the distinct list, populate the box, allow for new entry, and save that to the DB, do I have to write a code behind to repopulate the recordset, do I need to write a code behind to maintain the list paralleled to the recordset, or is there just a property I am missing?
Thanks
(Added screen showing event)
As suggested, using the on current event on the form and the after update solved the problem.
Clicking the form section detail selected the detail sections property page not the form. Selecting the form from the drop down on the property page displayed the events I was suggested to use.
Many thanks to those contributing.
As the first suggestion of this was from Remau, with assist in locating that event from hansup, I will mark remau's post as answer. Thank you to both.
Don't requery the form, just requery the combo. The best bet is probably the current event which will work if more than one person is doing data entry. It will also work if people are editing the table as well as entering data. Events that only fire when a record is added will not pick up changes to the combo contents.
Private Sub Form_Current()
Me.MyCombo.Requery
End Sub

Use databinding controls to add records to a dataset

I imagine this is a terribly Noobish question, and I hate to ask, but I've been trying to solve this problem all day,
I need to add rows to a DataSet using databound controls in VB.net.
I've set up the data bindings themselves, they're bound the the correct controls, and the BindingSource uses the correct DataSet. The DataSet is filled from the DataAdapter correctly, and the binding source works, as the navigation controls all work fine.
Here's the noob part: How do I use the controls to add new data to the DataSet?
I've been grappling with this all day. I've tried Google, this board, other boards, MSDN, everything I could think of, and nowhere did I find a simple tutorial on how to do it. Either I'm as thick as two short planks, or it's not as simple as I assumed it would be.
Could anyone help me with this please? It's driving me mad.
I guess there must be some kind of end-edit involved which would enable me to insert, update and delete records in the DataSet (as you would use with DataGridViews)
You can't add new data to the DataSet directly, you can add rows to the DataTables that reside in your DataSet.
You should have a button "Add item" or something like that, and in the event handler add the row to the data table. Ensure that the user can edit your edited row with your bound control and add a button "Save" which would do a TableAdapter.Update() on changed DataTable.
If you use a DataGridView, setting the property AllowUserToAddRows = true would add an empty, "dirty" row in which user can type data to add new records to the DataTable.
This two should get you started:
Walkthrough: Saving Data to a Database (Single Table)
Editing Data in Datasets