Overload resolution failed because no 'New' is accessible.

  • Thread starter Thread starter Jozef Halada
  • Start date Start date
J

Jozef Halada

I have a typed dataset called ClientDataSet which has a table called
ClientDataTable.
It is defined in a project called Data Access. Inside this project I can do
following:

Dim ClientDataTable As ClientDataSet.ClientDataTable
ClientDataTable = New ClientDataSet.ClientDataTable

I have another project in the solution, which is a WebApplication. When I
use the same code in the other project, I get the following error in the
compiler:

Overload resolution failed because no 'New' is accessible.


As a workaround, I have a method of a class that returns to me an empty
ClinetDataTable, but I would like to find out what is happening.

Joe
 
The behavior describes when the typed Dataset you've created is compiled
into a separate assembly from the one in which you're attempting to
instantiate the ClientDataTable. If you look at the code for the
ClientDataSet.ClientDataTable class, you'll find that its constructors are
limited to Friend access--that is, the class can be instantiated within the
assembly in which the class finds itself. If you want your code below to
work, then, you'll need to place the instantiating code below in the same
project as the dataset.

eb
 
Back
Top