How to dynamically change crystal report database connection

后端 未结 3 584
自闭症患者
自闭症患者 2020-12-17 04:15

I am new with crystal reports. I tried to to implement the crystal report in my win form c# application using report wizard visual studio 2012, so don\'t know what happen\'s

3条回答
  •  庸人自扰
    2020-12-17 05:06

    strServer= ConfigurationManager.AppSettings["ServerName"].ToString();
    strDatabase= ConfigurationManager.AppSettings["DataBaseName"].ToString();
    strUserID= ConfigurationManager.AppSettings["UserId"].ToString();
    strPwd= ConfigurationManager.AppSettings["Password"].ToString();
    
    //may be you need to set the integrated security to false, first.
    report.DataSourceConnections[o].IntegratedSecurity = False;
    
    report.DataSourceConnections[0].SetConnection(strServer, strDatabase, strUserID, strPwd);
    

提交回复
热议问题