This is a migrated thread and some comments may be shown as answers.

type initializer problem

1 Answer 127 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Wilfrid BILLIOUW
Top achievements
Rank 1
Wilfrid BILLIOUW asked on 24 Sep 2008, 07:39 PM
Hi,

I would like to try the fantastic Reporting Control in a winform application.
Unfortunately I got an error on the first line of my application... Look at the code below.

The error is
Exception has been thrown by the target of an invocation
The type initializer of 'MyObj.OrdersData' threw an exception

In fact the OrdersData could not find (I think) the connection string in my app.config

What could I do ?

Partial

Public Class Report1
Inherits Telerik.Reporting.Report
Public Sub New()
    InitializeComponent()
    Dim Orders As MyObj.OrdersCollection = MyObj.OrdersFacade.GetAll
      ' me.datasource = Orders
End Sub
Public Sub main()
End Sub
End
Class

1 Answer, 1 is accepted

Sort by
0
Svetoslav
Telerik team
answered on 25 Sep 2008, 04:47 PM
Hi Wilfrid BILLIOUW,

That's correct. The error message sounds like there is a problem with the MyObj.OrdersData constructor and most possible an exception is being thrown inside it. To find out the actual problem you may surround the problematic code with Try-Catch and use the debugger to diagnostic the problem source and reason.

Kind regards,
Svetoslav
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
General Discussions
Asked by
Wilfrid BILLIOUW
Top achievements
Rank 1
Answers by
Svetoslav
Telerik team
Share this question
or