Overload resolution failed because no 'New' is accessible.

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
 
E

Ernie B.

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top