覆盖连接字符串

编程入门 行业动态 更新时间:2024-10-24 20:12:36
本文介绍了覆盖连接字符串的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

emp数据库(连接字符串vsspl-005 \ sqlexpress)员工数据库(连接字符串vsspl-002 \ sqlexpress) 运行时员工数据库 当我给打印按钮emp数据库 上面的4个图显示了问题. 请帮助我,最近四天我一直在努力! 我有一个使用数据库专家连接到数据库的水晶报表,连接字符串为vsspl-005 \ sqlexpress,我想将连接字符串覆盖为vsspl-002 \ sqlexpress. 我已经在webconfig文件中写入了连接字符串,效果很好. 例如,使用数据库专家将报告连接到emp数据库,并将覆盖字符串连接到webconfig文件中的employee数据库. 运行时,它显示正确的员工数据库,但是当我打印时,它显示登录提示,服务器名称与vsspl-005 emp数据库相同. 在pdf中,它正在打印eml数据库,但我希望在pdf中并打印出employee数据库. 请帮帮我. 我想在运行时以及在pdf中给print命令时都覆盖连接字符串.

emp database(connection string vsspl-005\sqlexpress)employee database(connection string vsspl-002\sqlexpress) runtime employee database when i give print button emp database The above 4 fig displays the problem. Please help me, I have been trying for the last four days! I''ve one crystal report which is connected to the database using database expert and connection string is vsspl-005\sqlexpress and I want to override the connection string to vsspl-002\sqlexpress. I''ve writen the connection string in webconfig file it is working well. For example, the report is connected to the emp database using database experts and the overriding string is connected to the employee database in webconfig file. When I run it is displaying correct employee database but when I give print it is displaying the logon prompt with server name same vsspl-005 emp database. In the pdf it is printing the eml database but I want the employee database in the pdf and print. Please help me. I want to override the connection string both the time while its running and when I give print command in pdf also. Please can any one help me.

推荐答案

好..这很简单.. 因此,您要做的就是使包含要覆盖的连接的方法具有关键字virtual,并使包含覆盖的连接的方法具有关键字override关键字(假设它们具有相同的方法名称). 然后只需使用所需的参数调用方法的名称,它就可以正常工作. :) ok..That is simple.. so what you would do is to make the method containing the connection to be overridden have the keyword virtual and the method containing the overriding connection have the keyword override keyword (assuming they have the same method names). and then just call the name of the method with the required parameters, it should work good. :)

更多推荐

覆盖连接字符串

本文发布于:2023-08-01 08:52:34,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1267011.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:字符串

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!