private void SaveData2() { WpfApplication.Database1DataSet database1DataSet = ((WpfApplication.Database1DataSet)(this.FindResource("database1DataSet"))); // Load data into the table Love. You can modify this code as needed. WpfApplication.Database1DataSetTableAdapters.LoveTableAdapter database1DataSetLoveTableAdapter = new WpfApplication.Database1DataSetTableAdapters.LoveTableAdapter(); database1DataSetLoveTableAdapter.Connection.ConnectionString = DB_CONNECTION_STR; database1DataSetLoveTableAdapter.Update(database1DataSet.Love); }
private void RefreshDBData() { WpfApplication.Database1DataSet database1DataSet = ((WpfApplication.Database1DataSet)(this.FindResource("database1DataSet"))); // Load data into the table Love. You can modify this code as needed. WpfApplication.Database1DataSetTableAdapters.LoveTableAdapter database1DataSetLoveTableAdapter = new WpfApplication.Database1DataSetTableAdapters.LoveTableAdapter(); database1DataSetLoveTableAdapter.Connection.ConnectionString = DB_CONNECTION_STR; database1DataSetLoveTableAdapter.Fill(database1DataSet.Love); System.Windows.Data.CollectionViewSource loveViewSource = ((System.Windows.Data.CollectionViewSource)(this.FindResource("loveViewSource"))); loveViewSource.View.MoveCurrentToFirst(); }