关于Crystal Reports连接字符串 [英] about crystal reports connection string

查看:91
本文介绍了关于Crystal Reports连接字符串的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我创建了水晶报表,其中我使用数据库专家选项并创建新连接,从数据库中获取一张表(SQL SERVER 2005)并拖放某些字段,最终报表运行,这是在集成security = true中完成的,

当我在其他本地计算机上运行该项目时,报告要求登录,因此我将不更改连接字符串,如何完成?

i created crystal report,in that i use database expert option and crate new connection take one table from database(SQL SERVER 2005) and drag and drop some field,finally report is run,this is done in integrated security=true,

when that project i run on other local machine,report ask for login,so i wnt change connection string,how it to done?

推荐答案

嘿, >
只需使用以下代码创建密钥即可.您只需更改数据库所在的ServerName键值即可.


代码在下面,

hey man,

just create the keys for using the below code. you just change the ServerName key value where the database is located.


code is below,

strServer= ConfigurationManager.AppSettings["ServerName"].ToString();
strDatabase= ConfigurationManager.AppSettings["DataBaseName"].ToString();
strUserID= ConfigurationManager.AppSettings["UserId"].ToString();
strPwd= ConfigurationManager.AppSettings["Password"].ToString();

report.DataSourceConnections[0].SetConnection(strServer, strDatabase, strUserID, strPwd);



如果您有任何疑问,请告诉我



please let me know if you have any doubt


当您更换服务器时,Crystal Reports不能很好地运行...您需要实现一些用于获取Crystal Report,更改数据库的代码,登录名,服务器名称等,然后打开报告(在运行时).

本文为您提供了基础知识:在VS2005中的运行时更改Crystal Report Database登录信息 [ ^ ]

另外,Google Crystal Reports会在运行时更改登录名.
Crystal Reports doesn''t play nicely when you change servers... you need to implement some code that takes your crystal report, changes the database, login, server name etc, then opens the report (at run time).

This article gives you the basics on it: Changing Crystal Report Database logon information at runtime in VS2005[^]

Alternatively, google Crystal Reports change login at runtime.


这篇关于关于Crystal Reports连接字符串的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆