Can 2 different projects in the same solution share the same strongly typed dataset

M

moondaddy

I have 2 projects in the same solution that have a common strongly typed
dataset which they both use. Can they share it so that one project can pass
the dataset and it's data to the other project where the 2nd project can use
the methods and properties of this strongly typed dataset?

something like this:

'In project 1
public function Get_MyDataSet() as myDataSet
dim ds as new myDataSet
'populate the dataset here
return ds
End Function

In project 2
private Sub MyTest()
Dim ds as myDataSet = Project1.Get_MyDataSet()
End Sub
 
K

Kevin Yu [MSFT]

Thanks for Bill's response!

Hi moondaddy,

First of all, I would like to confirm my understanding of your issue. From
your description, I understand that you need to use the class which was
defined in one project, in another project. If there is any
misunderstanding, please feel free to let me know.

As far as I know, this is possible. For example, you have two projects in a
solution: Project1 and Project2. The typed DataSet is defined in Project1.
If Project2 needs to utilize it, we have to add reference to Project1. Here
are the steps:

1. In Solution Explorer, right click Project2 and select Add Reference. If
you cannot see Solution Explorer, select Solution Explorer from the View
menu.
2. In the Projects tab, double click Project1 and click OK button.

Then you can use classes defined in Project1 with the following format.

Namespace.Class

If both projects are in the same namespace, you can omit Namespace.

HTH. If anything is unclear, please feel free to reply to the post.

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."
 

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