Telerik report not working

前端 未结 2 1700
独厮守ぢ
独厮守ぢ 2021-01-29 14:23

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

相关标签:
2条回答
  • 2021-01-29 14:29

    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:

    an error has occurred while processing table 'crosstab 1' ... format of the initialization string does not conform to specification starting at index 0

    This error is because of having 1 more connection string.

    Maybe this discussion on the Telerik site entitled Set CrossTab DataSource in code-behind will help.

    0 讨论(0)
  • 2021-01-29 14:40
    • Go to the folder where your report project is.
    • Open the folder and look for the file "Telerik.ReportDesigner.exe.config"
    • Open the file in Visual Studio and copy the connection string
    • Past the above connection string to your web.config

    You can find the above here towards the end of the video (3':15'')

    0 讨论(0)
提交回复
热议问题