在 web.config 中使用水晶报表的连接字符串
我在两台使用不同 odbc dsn 的服务器之间遇到问题。
我的应用程序运行良好,但 Crystal Reports 使用原始 odbc 连接,我该如何解决此问题?
我正在考虑在 web.config 中使用相同的连接字符串,但我不知道如何操作。
找到这个,但对我来说太混乱了,
谢谢,
I`m having problems between two servers, wich use differente odbc dsn.
My apps work great but crystal reports uses the original odbc connection, how can I fix this?
I'm thinking of using the same connection string in the web.config, but I don't know how.
found this but is too confusing for me
thanks,
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您不能像使用 ado.net 连接一样使用连接字符串。但是,您当然可以使用 web.config 中的值来指定连接信息。创建 ConnectionInfo 类的实例并设置 ServerName、DatabaseName、UserID 和 Password 属性。然后将其附加到报告中的每个表格中:
如果您尝试使用此建议,请注意我的草率打字...
You can't use a connection string in the same way you can with an ado.net connection. However, you can certainly use values from the web.config to specify the connection info. Create an instance of the ConnectionInfo class and set the ServerName, DatabaseName, UserID, and Password properties. Then attach it to each of the tables in the report:
If you try to use this suggestion, beware of my sloppy typing...
您可以使用连接字符串。
您必须创建数据库提供程序 ConnectionStringBuilder 的实例,传递从配置文件中提取的连接字符串。这是 VB 中的一个例子。
You can use the connection string.
You have to create an instance of the database provider ConnectionStringBuilder passing in the Connection String pulled from a config file. Here is an example in VB.