我想做一张医生处方笺的报表,但是做出来的报表都读不出数据,大家帮我看看我写的语句有没有错 private void FormSrytalreport_Load(object sender, EventArgs e)
{
try
{
//string st = SQL.getCon();
SqlConnection con = new SqlConnection(SQL.getCon());
string sql = "select * from patient_cf";
con.Open();
SqlDataAdapter sda = new SqlDataAdapter(sql, con);
DataSet ds = new DataSet();
sda.Fill(ds, "patient_cf");
CrystalReport1 crr = new CrystalReport1();
crr.SetDataSource(ds.Tables["patienet_cf"]);
this.crystalReportViewer1.ReportSource = crr; }
catch (Exception ex)
{
MessageBox.Show(ex.ToString());
}
我运行了程序后,报表只显示了文本对象,读不出字段。如下:
http://my.csdn.net/my/album/detail/1179327
{
try
{
//string st = SQL.getCon();
SqlConnection con = new SqlConnection(SQL.getCon());
string sql = "select * from patient_cf";
con.Open();
SqlDataAdapter sda = new SqlDataAdapter(sql, con);
DataSet ds = new DataSet();
sda.Fill(ds, "patient_cf");
CrystalReport1 crr = new CrystalReport1();
crr.SetDataSource(ds.Tables["patienet_cf"]);
this.crystalReportViewer1.ReportSource = crr; }
catch (Exception ex)
{
MessageBox.Show(ex.ToString());
}
我运行了程序后,报表只显示了文本对象,读不出字段。如下:
http://my.csdn.net/my/album/detail/1179327
sda.Fill(ds, "patient_cf");
CrystalReport1 crr = new CrystalReport1();
crr.SetDataSource(ds.Tables["patienet_cf"]);
CrystalReport1 crr = new CrystalReport1();
crr.SetDataSource(ds.Tables["patienet_cf"]);是一样的么 ?2个英文?
patient_cf和patienet_cf