R
Rakshithc
Guest
previously I have created one project with .mdf file failed to make display in Listbox...
but same I failed in Make changes in dataset..
code is below
Public Class Form1
Private Sub ReportBindingNavigatorSaveItem_Click(sender As Object, e As EventArgs) Handles ReportBindingNavigatorSaveItem.Click
Me.Validate()
Me.ReportBindingSource.EndEdit()
Me.TableAdapterManager.UpdateAll(Me.StReportDataSet)
End Sub
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
TODO: This line of code loads data into the StReportDataSet.Report table. You can move, or remove it, as needed.
Me.ReportTableAdapter.Fill(Me.StReportDataSet.Report)
End Sub
Private Sub Form1_FormClosing(sender As Object, e As FormClosingEventArgs) Handles Me.FormClosing
Me.ReportBindingSource.EndEdit()
Me.ReportTableAdapter.Update(Me.StReportDataSet.Report)
End Sub
End Class
I made form1 closing code to save the changed data in data set. ..
Table pic
Dataset interface
After Run the program
I made changes by input 5 Row..and clicked save then close. .
Data is same as previous
Then how to do save and update the data?
Continue reading...
but same I failed in Make changes in dataset..
code is below
Public Class Form1
Private Sub ReportBindingNavigatorSaveItem_Click(sender As Object, e As EventArgs) Handles ReportBindingNavigatorSaveItem.Click
Me.Validate()
Me.ReportBindingSource.EndEdit()
Me.TableAdapterManager.UpdateAll(Me.StReportDataSet)
End Sub
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
TODO: This line of code loads data into the StReportDataSet.Report table. You can move, or remove it, as needed.
Me.ReportTableAdapter.Fill(Me.StReportDataSet.Report)
End Sub
Private Sub Form1_FormClosing(sender As Object, e As FormClosingEventArgs) Handles Me.FormClosing
Me.ReportBindingSource.EndEdit()
Me.ReportTableAdapter.Update(Me.StReportDataSet.Report)
End Sub
End Class
I made form1 closing code to save the changed data in data set. ..
Table pic

Dataset interface

After Run the program

I made changes by input 5 Row..and clicked save then close. .
Data is same as previous

Then how to do save and update the data?
Continue reading...