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.
5 Replies - 4572 Views - Last Post: 25 June 2011 - 07:08 PM
#1
Question: VP MS Visual Studio 2010 - Saving Dataset with user input
Posted 17 June 2011 - 10:51 AM
Replies To: Question: VP MS Visual Studio 2010 - Saving Dataset with user input
#2
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
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
#3
Re: Question: VP MS Visual Studio 2010 - Saving Dataset with user input
Posted 24 June 2011 - 03:54 PM
sriggs, 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.
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
#4
Re: Question: VP MS Visual Studio 2010 - Saving Dataset with user input
Posted 24 June 2011 - 04:02 PM
#5
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).
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).
#6
Re: Question: VP MS Visual Studio 2010 - Saving Dataset with user input
Posted 25 June 2011 - 07:08 PM
sriggs, 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).
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.
Page 1 of 1
|
|

New Topic/Question
Reply



MultiQuote





|