How to do this

  • Thread starter Thread starter Bob Dufour
  • Start date Start date
B

Bob Dufour

I created a form for enetering values in lookup tables (eg Phone Types) in a
project. The form uses a SQLdataAdapter and works fine in project A.

In another solution - Project B- I want to reuse the same form. It will look
in the same database as it does in project A.

If I go in poroject B an add the form as an existing Item from the folder in
project A as soon as I add the existing item to project B I get 3 errors in
the task lisdt window TypeProjectA.dsPhoneTypes is not defined (I get that
twice) and Oveload resolution failed because no acessible 'Fill' can be
called with these arguments. Evidently the form in project B needs to be
able to refer to the SQL server datasets that were used in project A. But
simply adding these datasets as existing items in project B does not work
either.

Can anyone tell me how I can reuse forms that use SQL data adapters without
having to recreate the form from scratch in each new project?

Thanks for any help.

Bob
 
Hi Bob,

I am not telling that this is the best approach, but what probably went
wrong when you was doing this.

When you have a form with connections made with the IDE and one dataset you
needs minimal this the other project

- The form.vb
- the from.resx
- the dataset1.xsd
- the dataset1.vb file from the dataset (the dataset class)

Normaly the form.resx file and the dataset1.vb are hidden in your solution
explorer.

You see them normal in windows explorer

I hope this helps,

Cor
 
You can move the sql dataAdapter declaration outside of the forms class and
use a shared instance between the project references.

If you have multiple objects or forms settings you want to share within a
solution you might consider using inherited forms. (
ms-help://MS.VSCC.2003/MS.MSDNQTR.80.en/dv_mancli/html/vbconforminheritance.
htm).



--------------------
 
Back
Top