首页 > 开发 > 综合 > 正文

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

2024-07-21 02:23:53
字体:
来源:转载
供稿:网友
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;

发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表