|
-
Jun 14th, 2006, 02:32 PM
#1
Thread Starter
Fanatic Member
[RESOLVED] Reset DataSet?
How do I reset a DataSet?
I have a form that is bound to a DataSet. When the user is done entering their information and they save the form's data, I call a ResetForm routine in my code. I can clear the DataSet with DataSet.Clear(), but that doesn't reset the Identity column's next value. Instead of giving me a 1 for a new record, it gives me the next number that would have been available after the preceeding record saved. (For example, if the record was saved and the identity value returned from the database was 300, then selecting to create a new transaction on my form gives me 301 in this field.)
The only problem is that I am showing this value to the end user. They know that a 1 means that they are going to get a new record. I don't want it to confuse them and make them think they may be editing an already existing record from the database.
I tried to set my DS = Nothing and then set it back to what it was supposed to be, but that seemed to cause some issues with my bindings.
Any assistance would be greatly appreciated!
My.Settings.Signature = String.Empty
-
Jun 14th, 2006, 02:40 PM
#2
-
Jun 15th, 2006, 01:42 PM
#3
Thread Starter
Fanatic Member
Re: Reset DataSet?
I just removed the Identity column from being visible on the form and used another textbox for this field.
Not ideal, but it gets the job done.
My.Settings.Signature = String.Empty
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|