正在研究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 [复制链接] [打 印][]
更多精彩
赞助商链接