Answered How to Move a Dataset Class

Bernie

Well-known member
Joined
Aug 13, 2007
Messages
98
Programming Experience
3-5
I work with a common database often, so I have a number of dataset and datatable classes that I like to copy from one program and reuse in the next. When I look at the files for a dataset class I see:

Dataset.Designer.vb
Dataset.vb
Dataset.xsc
Dataset.xsd
Dataset.xss

Which of these should I add to my new program to be able to reuse the class?

I know that if I add all 5 it creates problems with building in the new program.

Thanks for any suggestions.

Bernie
 
Last edited:
What you should do is just create a Class Library project and create your DataSet there. You build the library and you've got a DLL. You can then reference that DLL in any other project you like, with no need to copy any files at all.

Alternatively, if you really do want to recreate the DataSet in multiple projects then just select Add Existing Item and navigate to the XSD. Everything else will be created for you.
 
Xsd is it. Thank you!

I'll have to do some more learning on creating the library.

Thanks again for all your help!

Bernie
 
Xsd is it. Thank you!

I'll have to do some more learning on creating the library.

No brains required.. Just start a new project of type Class Library, do the same process youre doing now (add existing .. xsd) and then build it. You end up witha project that only has a dataset etc. You can then either use the DLL itself in other projects (references.. add reference.. files.. pick dll) or you can add the project (that makes the dll) to the existing solution (right click solution in solution explorer, choose add existing project..) remember to add reference to your dataset project too (refs.. add ref.. projects.. pick dataset project)

If you want a video of this, let me know
 
No brains required..

Good I'm out. ;}

It's been a long uphill learning curve on the .Net road this week and it's only Wednesday, hahahaha.

If you have the video already the link would be great. If not, don't go out of your way for me. You guys have been too helpfull already.

Thanks for all your and the others help.

Bernie
 
I tried copying the xsd file into a new project folder and then selected Add Existing and added that file. I built the program, but I can use that dataset. For example I try to
VB.NET:
Dim test as dsPatients
and it says that dsPatients doesn't exit. dsPatients.xsd is the file I added to the program.

What am I doing wrong?

Berne
 

Latest posts

Back
Top