开发学院数据库MSSQL Server 正在研究CrystalReport,下面的代码为当sql serve... 阅读

正在研究CrystalReport,下面的代码为当sql server密码不为空时的写法

 2007-11-11 10:10:55 来源:WEB开发网   
核心提示:ReportDocument rptDoc = new ReportDocument();rptDoc.Load("x:\\crystalreport\\crPull.rpt");TableLOGOnInfo LOGOnInfo = new TableLOGOnInfo();LOGOnInfo =

  ReportDocument rptDoc = new ReportDocument();
      rptDoc.Load("x:\\crystalreport\\crPull.rpt");
      
      TableLOGOnInfo LOGOnInfo = new TableLOGOnInfo();
      LOGOnInfo = rptDoc.Database.Tables["tblMagUserInfo"].LOGOnInfo;
      ConnectionInfo connectionInfo = new ConnectionInfo();
      connectionInfo = LOGOnInfo.ConnectionInfo;

      connectionInfo.ServerName = "myserver";
      connectionInfo.DatabaseName = "mydb";
      connectionInfo.UserID = "myid";
      connectionInfo.Password = "mypwd";

      rptDoc.Database.Tables["tblMagUserInfo"].ApplyLOGOnInfo(LOGOnInfo);

      CrystalReportViewer1.ReportSource = rptDoc;

Tags:正在 研究 CrystalReport

编辑录入:coldstar [复制链接] [打 印]
[]
  • 好
  • 好的评价 如果觉得好,就请您
      0%(0)
  • 差
  • 差的评价 如果觉得差,就请您
      0%(0)
赞助商链接