This is a migrated thread and some comments may be shown as answers.

Object not defined in current context

1 Answer 224 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Stephan
Top achievements
Rank 1
Stephan asked on 01 Apr 2009, 03:16 PM
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.




1 Answer, 1 is accepted

Sort by
0
Stephan
Top achievements
Rank 1
answered on 01 Apr 2009, 03:27 PM
Never mind, ever heard of Case Sensitive?

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

had to replace Report with report

THX


Tags
General Discussions
Asked by
Stephan
Top achievements
Rank 1
Answers by
Stephan
Top achievements
Rank 1
Share this question
or