错误CS0103 FastReport.net

时间:2014-06-18 05:41:44

标签: c# dataset fastreport

我是C#.net Windows Form开发人员。 我正在使用FastReport.net。但有一些错误。

这是我的代码:

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();

但是我的错误:

enter image description here

我错了什么?

2 个答案:

答案 0 :(得分:0)

如果您从其他键盘布局中随意打印符号,则可能会出现

CS0103

例如:E(英文),Е(俄文),Ε(希腊文)。

答案 1 :(得分:0)

如果name,tel和fax是表的名称,那么您可以尝试编写以下内容:

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();

您也可以尝试在Designer模式下删除连接。