0

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 ?

4
  • Where you defined these name, tel and fax? Jun 18, 2014 at 6:07
  • i solved this problem . thanks alote
    – Mr.Milad
    Jun 19, 2014 at 7:45
  • 1
    @MiladCoder please can you share how have you managed to solve this? Sep 27, 2015 at 17:45
  • 1
    i have the same problem could you say how you solved
    – r.hamd
    Sep 27, 2015 at 19:01

2 Answers 2

1

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.

0

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

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.