private void FRM_YuanGongGongZuoZhengDaYin_Load(object sender, EventArgs e)
        {
            BLL物流管理系统.报表统计.FRM_YuanGongGongZuoZheng.FRM_YuanGongGongZuoZhengClient myFRM_YuanGongGongZuoZhengClient = new BLL物流管理系统.报表统计.FRM_YuanGongGongZuoZheng.FRM_YuanGongGongZuoZhengClient();
            DataTable dtDingDan  = myFRM_YuanGongGongZuoZhengClient.FRM_YuanGongGongZuoZhengDaYin_Load_ChaXunYuanGong().Tables[0];
            DS_WuLiu  myDS_WuLiu = new DS_WuLiu();

            myDS_WuLiu.Tables["BaoBiao_员工表"].Merge(dtDingDan);
            CRP_YuanGongGongZuoZhengDaYin myCRP_YuanGongGongZuoZhengDaYin = new CRP_YuanGongGongZuoZhengDaYin();

            myCRP_YuanGongGongZuoZhengDaYin.SetDataSource(myDS_WuLiu);
            crystalReportViewer1.ReportSource = myCRP_YuanGongGongZuoZhengDaYin;
        }
예제 #2
0
 private void SaveAnyFileToDb(string strFileName)
 {
     //定义一个托管代码
     using (Stream sm = new FileStream(strFileName, FileMode.Open, FileAccess.ReadWrite, FileShare.None))
     {
         //文件类型
         string Ext = Path.GetExtension(strFileName);
         //文件名
         string Name = Path.GetFileName(strFileName);
         //二进制文件长度
         int length = (int)sm.Length;
         //二进制文件存放的二进制数组
         byte[] bytes = new byte[length];
         //内存流读取
         sm.Read(bytes, 0, length);
         //关闭内存流
         sm.Close();
         ////将数据保存到数据库中
         try
         {
             BLL物流管理系统.报表统计.FRM_YuanGongGongZuoZheng.FRM_YuanGongGongZuoZhengClient myFRM_YuanGongGongZuoZhengClient = new  BLL物流管理系统.报表统计.FRM_YuanGongGongZuoZheng.FRM_YuanGongGongZuoZhengClient(); //实例化BLL对象
             int i = myFRM_YuanGongGongZuoZhengClient.btnShangChuan_Click_UpdateYuanGong(bytes);                                                                                                      //执行插入方法保存图片
             if (i > 0)
             {
                 MessageBox.Show("保存成功!", "信息提示");
             }
         }
         catch (Exception exc)
         {
             MessageBox.Show(exc.ToString());//抛出异常
         }
     }
 }