Solved

Use an existing VB.Net form in another project

Posted on 2013-06-04
5
466 Views
Last Modified: 2013-06-13
I am trying to take a complex form which exists in one project into another project.

The form has a couple of datasets and about 10 table adaptors.

Is there any way to do this? - I have been trying with a simple form with one table adaptor with no success
0
Comment
Question by:grwallace
  • 2
  • 2
5 Comments
 
LVL 42

Expert Comment

by:sedgwick
ID: 39218671
add new class library project and add the complex form with all the datasets and other stuff the form uses.
now u can use the dll in the 2 projects by adding the project reference in visual studio.
0
 

Author Comment

by:grwallace
ID: 39218768
Thanks for the suggestion, but how do I go about this? it is something I have never done before.

I tried creating a class library project then add existing items then copying the items in. It gave the error "The Typed Dataset will Not Compile" etc and overflowed with errors.
0
 
LVL 42

Expert Comment

by:sedgwick
ID: 39218829
after you create the class library project, copy all relevant files from the explorer (not visual studio), into the class library directory.
then from visual studio use add existing to add all the files from the directory.
0
 

Author Comment

by:grwallace
ID: 39218958
Can't seem to get this to work.

I have created a simple form project with a single table in the dataset and copied everything into the class library project but all I get is hundreds of errors. Any assistance would be gratefully received.
0
 
LVL 83

Accepted Solution

by:
CodeCruiser earned 500 total points
ID: 39242361
Datasets are added to the project not form so you would need to add existing datasets as well. References to these datasets are usually prefixed with project name so you will have problems there. You may have to add form and datasets to DLL project and then redo bindings.
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I think the Typed DataTable and Typed DataSet are very good options when working with data, but I don't like auto-generated code. First, I create an Abstract Class for my DataTables Common Code.  This class Inherits from DataTable. Also, it can …
Introduction When many people think of the WebBrowser (http://msdn.microsoft.com/en-us/library/2te2y1x6%28v=VS.85%29.aspx) control, they immediately think of a control which allows the viewing and navigation of web pages. While this is true, it's a…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…
Attackers love to prey on accounts that have privileges. Reducing privileged accounts and protecting privileged accounts therefore is paramount. Users, groups, and service accounts need to be protected to help protect the entire Active Directory …

713 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question