Quantcast
Channel: Windows Presentation Foundation (WPF) forum
Viewing all articles
Browse latest Browse all 18858

storing selected foreign key values from WPF ComboBox selection into current ACCDB master record

$
0
0

I have partially developed a WPF/C# interface to an ACCDB.

The data values from the master table show up correctly in TextBoxes.

I am trying to further implement the desired interface which shows values in these TextBoxes, in addition to WPF ComboBoxes which allow the user to choose values(via foreign key) from another table, and store the foreign key value into the primary (master) table.

When a ComboBox is selected, the list of acceptable values is shown.  When a value is selected, the ComboBox collapses and retains the selected value.  However, I have not successfully stored the new Foreign Key value into the master record.

I have included the following code:

     private List<RMC_Job_Log> _jobLog;

     public List<RMC_Job_Log> Job_Log

     {

          get

          {

               return _jobLog;

          }

          set

          {

               _jobLog = value;

               OnPropertyChanged("Job_Log");

          }

     }

When I attempt to run the WPF & C# code that includes this code segment, I get the following errors:

  The_best_overloaded_method_match_for_'System.Windows.DependencyObject.OnPropertyChanged(System.Windows.DependendyPropertyChangedEventArgs)'_has_some_invalid_arguments'

Argument 1:  cannot convert from 'string' to 'System.Windows.DependencyPropertyChangedEventArgs'

If I comment out the OnPropertyChanged statement, the errors disappear, and the interface appears to work, but the new Foreign Key values are not saved.  (The ComboBoxes show the first valid value from the detail table, instead, rather than the value corresponding to the selected master record and its selected foreign key values.)

How can I (1)eliminate the errors, and (2)cause the current record to save the desired foreign key values?





Viewing all articles
Browse latest Browse all 18858

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>