Mr.Milad
Mr.Milad

Reputation: 57

Error CS0103 FastReport.net

i am C#.net Windows Form developer . i am using FastReport.net . but have some error .

this is my code :

DataSet ds = new DataSet();
SqlConnection cnn = new SqlConnection("MyCnnStr");
SqlCommand cmd = new SqlCommand();
cmd.Connection = cnn;
cmd.CommandText = "select * from test";
cmd.CommandType = CommandType.Text;
SqlDataAdapter dap = new SqlDataAdapter(cmd);
dap.Fill(ds, "ds");
report1.RegisterData(ds.Tables[0],"ds");
report1.GetDataSource("ds").Enabled = true;
report1.Load("Untitled.frx");
report1.Show();

but my error :

enter image description here

what is my wrong ?

Upvotes: 0

Views: 2268

Answers (2)

xaml
xaml

Reputation: 192

If name, tel and fax is names of tables, then you can try to write following:

DataSet ds = new DataSet();
SqlConnection cnn = new SqlConnection("MyCnnStr");
SqlCommand cmd = new SqlCommand();
cmd.Connection = cnn;
cmd.CommandText = "select * from test";
cmd.CommandType = CommandType.Text;
SqlDataAdapter dap = new SqlDataAdapter(cmd);
dap.Fill(ds, "ds");
report1.RegisterData(ds.Tables[0],"ds");
report1.GetDataSource("ds").Enabled = true;
report1.GetDataSource("name").Enabled = true; // add this part
report1.GetDataSource("tel").Enabled = true;  //
report1.GetDataSource("fax").Enabled = true;  //
report1.Load("Untitled.frx");
report1.Show();

Also you can try delete connections in Designer mode.

Upvotes: 1

Konstantin Dedov
Konstantin Dedov

Reputation: 425

CS0103 may appear if you casually print symbol from other keyboard layout.

For example: E (English), Е (Russian), Ε (Greek).

Upvotes: 0

Related Questions