update database from tableadapter
I have this code and I´m trying to update the database i´ve already have de data set BDHERGAIMDataSet with all my tables( tbboletines is one of them) i add a new row, and set the values of each column of the row in the table and then try to update the database.
It doesn´t give me any errors when I run it but it doesn´t write nothing on the database table....
I might be missing something but I really don´t know... Thanks for any help!!!!
Dim newvobol As BDHERGAIMDataSet.tbboletinesRownewvobol =Me.BDHERGAIMDataSet.tbboletines.NewtbboletinesRow
newvobol.idnaturaleza = 1
newvobol.idtipoboletin = 2
newvobol.fechaingreso = Now()
BDHERGAIMDataSet.tbboletines.Rows.Add(newvobol)
Me.TbboletinesTableAdapter1.Update(newvobol)
- Moved byYiChun ChenMSFT, ModeratorFriday, November 06, 2009 8:22 AMVB issue (From:Visual Studio Setup and Installation)
Answers
Thanks for the help... Malange I have the tables within the application not in server (yet)...
With this help and some search online I figured it out.
Thanks
I am very glad you did sort it out, can you propose as answered or helpful please. so we can move on.
Don't judge me, just Upgrade me. Thanks!- Marked As Answer byreyfon Friday, November 06, 2009 6:28 PM
All Replies
- Hi Reyfon,
I am moving this thread from Base "Visual Studio Setup and Installation" forum to the "Visual Basic General" forum, since the issue is related to VB programming. There are more VB experts in the "Visual Basic General" forum.
Thanks
Please remember to mark the replies as answers if they help and unmark them if they provide no help.
Welcome to the All-In-One Code Framework! If you have any feedback, please tell us. - Put this around it and look what happens
Try
Dim newvobol As BDHERGAIMDataSet.tbboletinesRownewvobol =Me.BDHERGAIMDataSet.tbboletines.NewtbboletinesRow
newvobol.idnaturaleza = 1
newvobol.idtipoboletin = 2
newvobol.fechaingreso = Now()
BDHERGAIMDataSet.tbboletines.Rows.Add(newvobol)
Me.TbboletinesTableAdapter1.Update(newvobol)
Catch ex as exception
Messagebox.show(ex.message)
end Try
Success
Cor Do you have the table in your server?if that is the case you need a command_builder = to update you table. that code is not enough.
I gonna shou something and you can change it: Dim command_builder As OleDbCommandBuilder ' Create the DataAdapter. data_adapter =New OleDbDataAdapter(ok, connectionString) ' Map Table to Contacts. data_adapter.TableMappings.Add("Table", "STUDENT") ' Make the CommandBuilder generate the ' insert, update, and delete commands. command_builder =New OleDbCommandBuilder(data_adapter) data_adapter.Update(mydaaset)Thanks for the help... Malange I have the tables within the application not in server (yet)...
With this help and some search online I figured it out.
Thanks
Thanks for the help... Malange I have the tables within the application not in server (yet)...
With this help and some search online I figured it out.
Thanks
I am very glad you did sort it out, can you propose as answered or helpful please. so we can move on.
Don't judge me, just Upgrade me. Thanks!- Marked As Answer byreyfon Friday, November 06, 2009 6:28 PM


