I am trying to teach myself WPF Programming and am having a struggle with a perplexing problem.
I have a strongly typed dataset named DM_EarningsDataSet which is used to track my part time job wages.
There are 7 tables in this dataset (Assignments, Companies, Earnings, Employees, Programs, Rates, and SpecialRateTypes.
I haven't listed the xaml code, but it appears OK since the forms are laid out correctly.
If I run the following code, it works with no problems. In fact there is similar code in all the forms I am using referencing different tables using similar code, and it works for all forms except for the following which references the programs table.
This code works:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;
namespace DM_Earnings_System_WPF
{
public partial class frmRates : Window
{
public frmRates()
{
InitializeComponent();
}
private DM_EarningsDataSet RateData = new DM_EarningsDataSet();
private DM_EarningsDataSetTableAdapters.RatesTableAdapter taRate = new DM_EarningsDataSetTableAdapters.RatesTableAdapter();
private DM_EarningsDataSetTableAdapters.TableAdapterManager taManager = new DM_EarningsDataSetTableAdapters.TableAdapterManager();
private CompanyLookupDataSet.CompaniesDataTable CompanyLookup = new CompanyLookupDataSet.CompaniesDataTable();
private EmployeeLookupDataSet.EmployeesDataTable EmployeeLookup = new EmployeeLookupDataSet.EmployeesDataTable();
private CollectionView RatesView;
private void frmRates_Loaded(object sender, System.Windows.RoutedEventArgs e)
{
CompanyLookupDataSetTableAdapters.CompaniesTableAdapter taCompany = new CompanyLookupDataSetTableAdapters.CompaniesTableAdapter();
taCompany.Fill(this.CompanyLookup);
EmployeeLookupDataSetTableAdapters.EmployeesTableAdapter taEmployee = new EmployeeLookupDataSetTableAdapters.EmployeesTableAdapter();
taEmployee.Fill(this.EmployeeLookup);
this.taRate.Fill(this.RateData.Rates);
.
.
.
.
.
}
However, when I run the following code it fails using the exact same coding technique but for a different form/table
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;
namespace DM_Earnings_System_WPF
{
public partial class frmPrograms : Window
{
public frmPrograms()
{
InitializeComponent();
}
private DM_EarningsDataSet ProgramData = new DM_EarningsDataSet();
private DM_EarningsDataSetTableAdapters.ProgramsTableAdapter taProgram = new DM_EarningsDataSetTableAdapters.ProgramsTableAdapter();
private DM_EarningsDataSetTableAdapters.TableAdapterManager taProgramsManager = new DM_EarningsDataSetTableAdapters.TableAdapterManager();
private CompanyLookupDataSet.CompaniesDataTable ProgramCompanyLookup = new CompanyLookupDataSet.CompaniesDataTable();
private EmployeeLookupDataSet.EmployeesDataTable ProgramEmployeeLookup = new EmployeeLookupDataSet.EmployeesDataTable();
private AssignmentsLookupDataSet.AssignmentsDataTable ProgramAssignmentLookup = new AssignmentsLookupDataSet.AssignmentsDataTable();
private SpecialRateTypeLookupDataSet.SpecialRateTypesDataTable ProgramSpecialRateTypeLookup = new SpecialRateTypeLookupDataSet.SpecialRateTypesDataTable();
private CollectionView ProgramsView;
private void frmPrograms_Loaded(object sender, System.Windows.RoutedEventArgs e)
{
CompanyLookupDataSetTableAdapters.CompaniesTableAdapter taCompany = new CompanyLookupDataSetTableAdapters.CompaniesTableAdapter();
taCompany.Fill(this.ProgramCompanyLookup);
EmployeeLookupDataSetTableAdapters.EmployeesTableAdapter taEmployee = new EmployeeLookupDataSetTableAdapters.EmployeesTableAdapter();
taEmployee.Fill(this.ProgramEmployeeLookup);
AssignmentsLookupDataSetTableAdapters.AssignmentsTableAdapter taAssignment = new AssignmentsLookupDataSetTableAdapters.AssignmentsTableAdapter();
taAssignment.Fill(this.ProgramAssignmentLookup);
SpecialRateTypeLookupDataSetTableAdapters.SpecialRateTypesTableAdapter taSpecialRateType = new SpecialRateTypeLookupDataSetTableAdapters.SpecialRateTypesTableAdapter();
taSpecialRateType.Fill(this.ProgramSpecialRateTypeLookup);
this.taProgram.Fill(this.ProgramData.Programs);
.
.
.
.
.
}
I get the following error:
"No value given for one or more required parameters", on the "this.taProgram.Fill(this.ProgramData.Programs);"
statement.
I know I am probably missing something very stupid, but I can't seem to figure this out.
Any help would be greatly appreciated.