I am getting an error CS1061 on the cd.Closeout with in this button click event to load data to a datagrid. Been trying to figure this out but with no luck.
Error as listed
Severity Code Description Project File Line Suppression State
Error CS1061 'MainWindow.CloseoutDataContext' does not contain a definition for 'Closeout' and no accessible extension method 'Closeout' accepting a first argument of type 'MainWindow.CloseoutDataContext' could be found (are you missing a using directive or an assembly reference?) ReportViewer C:\Users\keith\source\repos\ReportViewer\ReportViewer\MainWindow.xaml.cs 72 Active
I added a public class CloseoutDataContext to clear the error with the CloseoutDataContext cd = new CloseoutDataContext(); line
Error as listed
Severity Code Description Project File Line Suppression State
Error CS1061 'MainWindow.CloseoutDataContext' does not contain a definition for 'Closeout' and no accessible extension method 'Closeout' accepting a first argument of type 'MainWindow.CloseoutDataContext' could be found (are you missing a using directive or an assembly reference?) ReportViewer C:\Users\keith\source\repos\ReportViewer\ReportViewer\MainWindow.xaml.cs 72 Active
I added a public class CloseoutDataContext to clear the error with the CloseoutDataContext cd = new CloseoutDataContext(); line
C#:
private void ClosButton_Click(object sender, RoutedEventArgs e)
{
LoadCloseout();
}
private void LoadCloseout()
{
CloseoutDataContext cd = new CloseoutDataContext();
var closeout = (from p in cd.Closeout
select p).Take(10);
ReportFilter.ItemsSource = closeout;
ClosButton.Content = "CloseOuts Loaded";
}