Quantcast
Channel: Windows Forms Data Controls and Databinding forum
Viewing all articles
Browse latest Browse all 2535

VB Dataset Update with more than 127 fields

$
0
0

I could use a little direction with a problem. In my VB2010 app, I have a connection to a access db using the built-in table adapters, datasets, etc. everything works great. I have a large number of fields but under 127.

Now I want to add one more field to the table.  I can add the field but since the dataset object's update command does not support updating more than 126 fields at a time, how do I implement this newer field?

This new field will not be on any forms and it will be populated only when adding a new record (the field will be a date with the date the record was added).  For my purposes, it does not need to go into a second related table.

I have been looking for answers and the most common one is to have a second BindingSouce.  That sounds easy enough but I can't seem to figure out to implement this.

The current binding source is tied back to a DataSet and the DataSet is where the update, delete, insert commands are.  If I add another binding source and reference the existing DataSet, that seems to not be the way to go since that's were the problem lies.

If I create a new DataSet and associated binding source, then it would seem that I need to keep track of two sets of currencymanagers, etc. 

So assume that a table has fields 1-127:

Field1

Field2

.

.

Field127

When I add a new record the following is done (assuming all the data has been supplied by the user)

StampCollectionBindingSource.AddNew()
StampCollectionBindingSource.EndEdit()
TableAdapterManager.UpdateAll(Me.SCDBDataDataSet)
OK - that takes care of the first 126 fields - NOW - how do I implement this for the 127th field?

If its a matter of creating another dataset, then there are more questions.  Can two datasets reference the same table and row at the same time?  How do you keep them in sync so that when you update them - you are looking at the same row.  (As in when I add a new record to the table and all 126 fields are written by the first UpdateAll and if there is a second UpdateAll for a second DataSet - it writes the data to the same row for the 127th field).

Thanks and hopefully someone can make this process a little clearer!

Roger



Viewing all articles
Browse latest Browse all 2535

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>