5 Replies - 8280 Views - Last Post: 25 June 2011 - 07:08 PM Rate Topic: -----

#1 sriggs  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 3
  • Joined: 17-June 11

Question: VP MS Visual Studio 2010 - Saving Dataset with user input

Posted 17 June 2011 - 10:51 AM

Hello all.
I'm fairly new to the VB world. And i'm not an expert. I have an issue which is complex to me but probably a breeze for you all.
I had an Excel spreadsheet which I put in MS Access (database). I then took that database and used that as a source in VB to create a GUI for.
In VB I have an input text box to search and pull of different fields.
I created some queries for searches in from the text box.
I have have a dataset view of the data which has the binding navigator (add, insert, save).

The problem I have is that when I hit the '+' for add to add information and then click the 'save' button in the binding Navigator, the information I put in does not save. I check this by exit out of the program run (debug to open the app) and then open it back up to search and/or check for the new information I put in.

My overall goal is to create to publish the final code and use an a standalone program.

Also, as another option,(I would like to learn) Is there a way to map VB directly to an Excel file to have the user input information and save to the excel file.
I would like to get help on the first problem I mentioned.

Thanks for any help.

Is This A Good Question/Topic? 0
  • +

Replies To: Question: VP MS Visual Studio 2010 - Saving Dataset with user input

#2 billyboy630  Icon User is offline

  • D.I.C Head

Reputation: 6
  • View blog
  • Posts: 94
  • Joined: 09-October 09

Re: Question: VP MS Visual Studio 2010 - Saving Dataset with user input

Posted 24 June 2011 - 03:40 PM

Not sure exactly how you are viewing the data, but adding a record to the dataview isnt going to save it to the database, those are two different operations.

With that said if you really need to add the record to the "DATABASE" then look into insert command, again since you havent posted any code I dont know how you are connecting to the database, but you need to perfrom an insert

If you you just need to see the record at runtime then you can refresh whatever dataview you are using to view your data and you should see the record you added.

But it sounds like you want it added to the DataBase, so you have to create a new row and then insert the row to the database
Was This Post Helpful? 0
  • +
  • -

#3 Btu  Icon User is offline

  • D.I.C Regular

Reputation: 36
  • View blog
  • Posts: 250
  • Joined: 16-May 11

Re: Question: VP MS Visual Studio 2010 - Saving Dataset with user input

Posted 24 June 2011 - 03:54 PM

View Postsriggs, on 17 June 2011 - 10:51 AM, said:

Hello all.
I'm fairly new to the VB world. And i'm not an expert. I have an issue which is complex to me but probably a breeze for you all.
I had an Excel spreadsheet which I put in MS Access (database). I then took that database and used that as a source in VB to create a GUI for.
In VB I have an input text box to search and pull of different fields.
I created some queries for searches in from the text box.
I have have a dataset view of the data which has the binding navigator (add, insert, save).

The problem I have is that when I hit the '+' for add to add information and then click the 'save' button in the binding Navigator, the information I put in does not save. I check this by exit out of the program run (debug to open the app) and then open it back up to search and/or check for the new information I put in.

My overall goal is to create to publish the final code and use an a standalone program.

Also, as another option,(I would like to learn) Is there a way to map VB directly to an Excel file to have the user input information and save to the excel file.
I would like to get help on the first problem I mentioned.

Thanks for any help.

The changes in your dataset will not update in the actual database you're connected to unless you "commit" or "update" it in your code.
Post up a sample of your code and see if someone can help.

This post has been edited by Btu: 24 June 2011 - 03:55 PM

Was This Post Helpful? 0
  • +
  • -

#4 smohd  Icon User is offline

  • Critical Section
  • member icon


Reputation: 1820
  • View blog
  • Posts: 4,627
  • Joined: 14-March 10

Re: Question: VP MS Visual Studio 2010 - Saving Dataset with user input

Posted 24 June 2011 - 04:02 PM

You may start here:
http://www.codeproje...tware_Eng_.aspx
http://support.microsoft.com/kb/247412
Was This Post Helpful? 0
  • +
  • -

#5 sriggs  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 3
  • Joined: 17-June 11

Re: Question: VP MS Visual Studio 2010 - Saving Dataset with user input

Posted 25 June 2011 - 04:12 PM

Hey guys,
I have the following for the dataset view:
Private Sub CSXSwitchesTESTBindingNavigatorSaveItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CSXSwitchesTESTBindingNavigatorSaveItem.Click
Me.Validate()
Me.CSXSwitchesTESTBindingSource.EndEdit()
Me.TableAdapterManager.UpdateAll(Me.CSXSwitchesTESTDataSet)

End Sub

This is in the Binding Navigator buttons (insert, add, save etc.). I deleted the program and rewrote it. it appears to save now. I do have a couple other questions.
Once I publish my program....
My program accesses a database. My question is.... How do I change the path of how the program access my database. Or how do I re-write the program to prompt me for the location of the database file?

also,
Is there a way for VB to access an Excel file directly like it accesses a database file?

Thanks for all you all(s) advice (in advance).
Was This Post Helpful? 0
  • +
  • -

#6 Btu  Icon User is offline

  • D.I.C Regular

Reputation: 36
  • View blog
  • Posts: 250
  • Joined: 16-May 11

Re: Question: VP MS Visual Studio 2010 - Saving Dataset with user input

Posted 25 June 2011 - 07:08 PM

View Postsriggs, on 25 June 2011 - 04:12 PM, said:

Hey guys,
I have the following for the dataset view:
Private Sub CSXSwitchesTESTBindingNavigatorSaveItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CSXSwitchesTESTBindingNavigatorSaveItem.Click
Me.Validate()
Me.CSXSwitchesTESTBindingSource.EndEdit()
Me.TableAdapterManager.UpdateAll(Me.CSXSwitchesTESTDataSet)

End Sub

This is in the Binding Navigator buttons (insert, add, save etc.). I deleted the program and rewrote it. it appears to save now. I do have a couple other questions.
Once I publish my program....
My program accesses a database. My question is.... How do I change the path of how the program access my database. Or how do I re-write the program to prompt me for the location of the database file?

also,
Is there a way for VB to access an Excel file directly like it accesses a database file?

Thanks for all you all(s) advice (in advance).

You were better off doing what you did. I had a project like yours once and the designer code got all screwed up and I had to remake the app. Always keep a backup of a good working copy.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1