Page 1 of 1

Error CS0103 - The name does not exist in the current context

Posted: Wed Jan 13, 2010 6:46 am
by ksinfo
Hello!

After updating to version 2009.2.500.0 I recompiled my C# Project in VS 2008. Then I have started
the Report Designer and I got this error messages:

Code: Select all

c:\Users\User\AppData\Local\Temp\ld58oj0u.0.cs(256,40) : error CS0103: The name 'to' does not exist in the current context
....
I'm connecting the DataSource via Code like this:

Code: Select all

DataTable ll = DB.Query("SELECT....");
ll.TableName = "ll";

DataTable to = DB.Query("SELECT....");
to.TableName = "to";

Stimulsoft.Report.StiReport report = new Stimulsoft.Report.StiReport();
string reportfile = @".\report\Loadinglist.mrt";
report.Load(reportfile);

report.Dictionary.Databases.Clear();
report.Dictionary.DataSources.Clear();
report.Dictionary.Relations.Clear();

DataSet ds = new DataSet("ds");
ds.Tables.Add(ll);
ds.Tables.Add(to);
report.RegData("ds",ds);
report.Dictionary.Synchronize();

report.Design();
//eport.Render();
//report.Show();
If I look into the Source-code of the Report-file a saw that the Designer renamed the "to" member variable to "to_".
But if I change this variable name to "to" the designer renames it back to "to_". Very strange. Whats wrong with this report?

Code: Select all

public llDataSource ll;
public to_DataSource to_;  // <--- this should be "to"

Code: Select all

private void InitializeComponent()
{
this.to_ = new to_DataSource();  // <--  this should be "to"
this.ll = new llDataSource();
....


Error CS0103 - The name does not exist in the current context

Posted: Thu Jan 14, 2010 9:03 am
by Edward
Hi

We faced a lot of problems with reserved words when the report was being saved as a class. That is why to avoid such type of conflicts you still have to use 'to_' instead of 'to'.

Designer just did that renaming automatically.

Replacing were implementing long ago but there were an embarrassing error and sometimes this replacement in previous builds was not made correctly.

Thank you.