我是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();
但是我的错误:
我错了什么?
答案 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模式下删除连接。