Solved

Use an existing VB.Net form in another project

Posted on 2013-06-04
5
431 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

Simplifying Server Workload Migrations

This use case outlines the migration challenges that organizations face and how the Acronis AnyData Engine supports physical-to-physical (P2P), physical-to-virtual (P2V), virtual to physical (V2P), and cross-virtual (V2V) migration scenarios to address these challenges.

Question has a verified solution.

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

Suggested Solutions

A while ago, I was working on a Windows Forms application and I needed a special label control with reflection (glass) effect to show some titles in a stylish way. I've always enjoyed working with graphics, but it's never too clever to re-invent …
Parsing a CSV file is a task that we are confronted with regularly, and although there are a vast number of means to do this, as a newbie, the field can be confusing and the tools can seem complex. A simple solution to parsing a customized CSV fi…
Windows 10 is mostly good. However the one thing that annoys me is how many clicks you have to do to dial a VPN connection. You have to go to settings from the start menu, (2 clicks), Network and Internet (1 click), Click VPN (another click) then fi…
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …

770 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