By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,534 Members | 943 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,534 IT Pros & Developers. It's quick & easy.

How to do this

P: n/a
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
Nov 20 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Cor
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
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?

Nov 20 '05 #2

P: n/a
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).

--------------------
From: "Bob Dufour" <bo*****@hotmail.com>
Subject: How to do this
Date: Mon, 12 Jan 2004 14:48:53 -0500
Lines: 23
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
Message-ID: <er**************@TK2MSFTNGP12.phx.gbl>
Newsgroups: microsoft.public.dotnet.languages.vb
NNTP-Posting-Host: mail.thconsulting.com 216.13.34.30
Path: cpmsftngxa07.phx.gbl!cpmsftngxa06.phx.gbl!TK2MSFTN GP08.phx.gbl!TK2MSFTNGP12.
phx.gblXref: cpmsftngxa07.phx.gbl microsoft.public.dotnet.languages.vb:172232
X-Tomcat-NG: microsoft.public.dotnet.languages.vb

I created a form for enetering values in lookup tables (eg Phone Types) in aproject. 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 lookin 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 inproject 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


Nov 20 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.