如何在C#中获取Crystal Report的数据库凭据? [英] How to get the Database credentials for crystal report in C# ?

查看:75
本文介绍了如何在C#中获取Crystal Report的数据库凭据?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果我不知道Crystal报表中使用的数据库,而我想用C#代码访问它,那么我将如何了解数据库源和凭据?
我无法在没有数据库名称,密码等的情况下运行报告,因为它会抛出不匹配的错误数据库.

If I don''t know the database used in the crystal report and I want to access it in C# code then how will I get to know the database source and credentials ?
I am not able to run the report without the database name, password etc. as it is throwing an error database not matched.

推荐答案

显示水晶报表

write this line in your code before display a crystal report

reportViewer.EnableDatabaseLogonPrompt = false;



reportViewer是您的报表查看器对象的名称.



reportViewer is the name for your report Viewer object


请参阅Pratik,他们给出了非常基本的步骤来将Crystal Report与DB一起使用.尝试这种方式:)

http://csharp.net-informations.com/crystal-reports/csharp- crystal-reports-stepbystep.htm [ ^ ]
See Pratik they have given here very basic steps to use crystal report with DB. Try this way :)

http://csharp.net-informations.com/crystal-reports/csharp-crystal-reports-stepbystep.htm[^]


这篇关于如何在C#中获取Crystal Report的数据库凭据?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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