Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
155
Error in DataContext
posted

Hello,

I get an error in DataContext when running a report. In designtime the preview works fine but in runtime the error in DataContext popups with the following stacktrace:

Infragistics.Reports.Engine.EngineException: Error in DataContext =DataSources.sqlDataSourceSalesWeb. ---> Infragistics.Reports.Engine.Data.EngineDataException: Error in DataContext sqlDataSourceSalesWeb. ---> Infragistics.Reports.Engine.Data.ConnectionStringNotFoundException: Exception of type 'Infragistics.Reports.Engine.Data.ConnectionStringNotFoundException' was thrown.    at Infragistics.Reports.Engine.Data.QueryHelper.RunQuery[T](String dataProvider, String connectionString, Query query, IDictionary`2 parameterValues, Func`2 action, CommandBehavior behavior, DbConnection customDbConnection)    at Infragistics.Reports.Engine.Data.SqlReportDataProvider.Execute()    at Infragistics.Reports.Engine.Data.ReportDataSourceManager.GetReportDataSource(DataSource reportDataSource)    --- End of inner exception stack trace ---    at Infragistics.Reports.Engine.Data.ReportDataSourceManager.GetReportDataSource(DataSource reportDataSource)    at Infragistics.Reports.Expressions.RuntimeEvaluationContext.<>c__DisplayClass2.<AddDataSource>b__1()    at Infragistics.Reports.Expressions.EvaluatorHelper.Accessor(Object target, String propertyName, Boolean onParent, Boolean scaleUp)    at lambda_method(Closure , IRuntimeEvaluationContext )    at Infragistics.Reports.Expressions.EvaluatorVisitor.Evaluate(Expression expression)    --- End of inner exception stack trace --- An error occurred while binding an expression.

 

The XAML of the reportviewer is:

        <ig:XamReportViewer Grid.Row="1" Margin="12,12,12,43" Name="xamReportViewer">
            <ig:XamReportViewer.RenderSettings>
                <ig:ClientRenderSettings DefinitionUri="/SalesWeb.Sales;component/Reports/OrderConfirmation.igr" />
            </ig:XamReportViewer.RenderSettings>
        </ig:XamReportViewer>
 
Nothing is done in code behind to change the datasource or something.
What is it that I am doing wrong?
Thanks for any assitance.
Remko
Parents
No Data
Reply
  • 155
    Verified Answer
    Offline posted

    Found it, problem was that this is an application with multiple modules and the connection string was in the app.config of the module and not in the app.config of the main application.

     

Children
No Data