⑴ 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;
}
我做的水晶報表,給你參考下