Telerik 报告不起作用 [英] Telerik report not working
问题描述
处理报告ReportStandart"时出错:无法建立到数据库的连接.请验证您的连接字符串是否有效.如果您使用应用程序配置文件中的命名连接字符串,请确保名称正确并且连接字符串设置存在于应用程序的配置文件中.-------------内部异常 ------------- !
An error has occurred while processing Report 'ReportStandart': Unable to establish a connection to the database. Please, verify that your connection string is valid. In case you use a named connection string from the application configuration file, make sure the name is correct and the connection string settings are present in the configuration file of your application. ------------- InnerException ------------- !
推荐答案
在这个示例中,我们通过填充连接字符串得到了sqlDataSource:
In this sample, we have got sqlDataSource by filling connection string:
MyReport report = new MyReport();
string selectCommand = @"SELECT * FROM Sales.Store";
string connectionString = "Data Source=(local)\\SQLEXPRESS;Initial Catalog=AdventureWorks;Integrated Security=True";
Telerik.Reporting.SqlDataSource sqlDataSource = new Telerik.Reporting.SqlDataSource(connectionString, selectCommand);
report.DataSource = sqlDataSource;
就我而言,我的启动项目在其配置文件中有连接字符串,因此由于此错误,我无法在另一个项目中再次使用该连接字符串:
In my case, my start-up project has connection string in its config file so I cannot use the connection string again in another project because of this error:
处理表交叉表 1"时发生错误...初始化字符串的格式不符合规范从索引 0 开始
an error has occurred while processing table 'crosstab 1' ... format of the initialization string does not conform to specification starting at index 0
这个错误是因为多了 1 个连接字符串.
This error is because of having 1 more connection string.
也许 Telerik 网站上的这个讨论名为 Set CrossTab DataSource代码隐藏会有所帮助.
Maybe this discussion on the Telerik site entitled Set CrossTab DataSource in code-behind will help.
这篇关于Telerik 报告不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!