private void ImprimerOnePieceJointDepotPlgnt_Load(object sender, EventArgs e) { cmdPieceJointPlgnt.CommandText = "select [Num_Depot_piece],[Num_File],[Titre],[Image_depot_piece] from Depot_piece where Num_Depot_piece=" + id_PieceJointDepotPlgn.ToString(); cmdPieceJointPlgnt.Connection = cnx; da = new SqlDataAdapter(cmdPieceJointPlgnt); da.Fill(dsOnePieceJointPlgnt, "Depot_piece"); cmdInfoAvocat = new SqlCommand("select top(1) * from avocat", cnx); da1 = new SqlDataAdapter(cmdInfoAvocat); da1.Fill(dsOnePieceJointPlgnt, "avocat"); ReportOnePlgntDepotPiece i = new ReportOnePlgntDepotPiece(); i.SetDataSource(dsOnePieceJointPlgnt); crystalReportViewerPlgnt.ReportSource = i; crystalReportViewerPlgnt.Refresh(); }
private void ImprimerOnePieceJointDepotOrder_Load(object sender, EventArgs e) { if (cnx.State == ConnectionState.Closed) { cnx.Open(); } CmdPieceJointOrder.CommandText = "select [Num_Depot_piece],[Num_File],[Titre],[Image_depot_piece] from Depot_piece where Num_Depot_piece=" + id_PieceJointDepotOrder + ""; CmdPieceJointOrder.Connection = cnx; da = new SqlDataAdapter(CmdPieceJointOrder); da.Fill(ds, "Depot_piece"); CmdInfo = new SqlCommand("select top(1) * from avocat", cnx); da1 = new SqlDataAdapter(CmdInfo); da1.Fill(ds, "avocat"); ReportOnePlgntDepotPiece i = new ReportOnePlgntDepotPiece(); i.SetDataSource(ds); crystalReportViewer1.ReportSource = i; cnx.Close(); }