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

Linq + No parameterless constructor defined for this object.

1 Answer 105 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Marijan
Top achievements
Rank 2
Marijan asked on 30 Jul 2009, 09:43 AM
Hi,

I'm trying to pass parameter through report default constructor and then bind report controls with values.
After that i get this error:

Server Error in '/' Application.

No parameterless constructor defined for this object.

This is the report code:

Public Sub New(ByVal id As String)

 

InitializeComponent()

 

Dim db As New DataClassesDataContext

 

 

Dim q_worksheet = (From _wo In db.Worksheets Where _wo.WorksheetID.ToString = id Select _wo).First

 

txtBoat.Value = q_worksheet.BoatID

 

End Sub


Is there any other way to use parameters with linq to sql?

1 Answer, 1 is accepted

Sort by
0
Massimiliano Bassili
Top achievements
Rank 1
answered on 04 Aug 2009, 10:59 AM
As far as I know Telerik Reports are standard .NET classes, so this should work. Try with a default class and verify if your approach is correct. If needed add a default constructor, but still invoke the one with parameters when you instantiate the reports.

Cheers
Tags
General Discussions
Asked by
Marijan
Top achievements
Rank 2
Answers by
Massimiliano Bassili
Top achievements
Rank 1
Share this question
or