⑴ vs2010制作水晶报表出现加载数据库信息失败,哪位高手能给解答一下!谢谢了!
InitializeComponent();
//Console.Write(s);
string constr = "Data Source=192.168.0.85;Initial Catalog=CMBARCODE;Persist Security Info=True;User ID=dbname;Password=access";
DataOpt daa = new DataOpt();
SqlConnection conn = new SqlConnection(constr);
DataSet1 mydata = new DataSet1();
string sqlstr = "select JobNum,RequireDate,PartNum,PartDescription,RequireQty,IssuedQty, purcomment,warehousecode,pickper,sendper from material_dan where JobNum ='" + s + "'";
SqlDataAdapter myadapter = new SqlDataAdapter(sqlstr, conn);
myadapter.Fill(mydata, "material_dan");
CrystalReport3 cr = new CrystalReport3();
cr.SetDataSource(mydata);
crystalReportViewer1.ReportSource = cr;
}
我做的水晶报表,给你参考下