Object not defined in current context

2 posts, 0 answers
  1. Stephan
    Stephan avatar
    71 posts
    Member since:
    Jul 2007

    Posted 01 Apr 2009 Link to this post

    Hi Guys, we working on some reports, going over them again, reading what would be better.

    We started creating reports using the wizard, so we had designtime support. Great, that works. But now I want to add some more flexibilitty to the code. So I added a NeedDataSource event to the report including the next code:

     this.generalReportDataSetTableAdapter1.Connection.ConnectionString = ConfigurationManager.ConnectionStrings["Report.ConnectionString"].ConnectionString; 
                this.generalReportDataSetTableAdapter1.FillByClientIdAndBetweenStartAndEndDate(this.generalReportDataSet.GeneralReportDataSetTable, 
                    Convert.ToInt32(this.ReportParameters["pClientId"].Value), Convert.ToDateTime(this.ReportParameters["pStartDate"].Value), Convert.ToDateTime(this.ReportParameters["pEndDate"].Value)); 
     
                Processing.Report report = (Processing.Report)sender; 
                Report.DataSource = this.generalReportDataSet; 

    of course in de constructor I set: this.DataSource = null;

    Nou when I set breakpoints, I can see my DS is filled. No problem but all my textboxen throw: the expression contains object 'Name' that is not defined in the current context. Where name is different for every textbox.

    The structure of the DS is still the same.

    It seems I cannot get the fields in the DB anymore

    How is that possible.




  2. Stephan
    Stephan avatar
    71 posts
    Member since:
    Jul 2007

    Posted 01 Apr 2009 Link to this post

    Never mind, ever heard of Case Sensitive?

    Processing.Report report = (Processing.Report)sender;             
    Report.DataSource = this.generalReportDataSet;

    had to replace Report with report

    THX


  3. DevCraft banner
Back to Top