Maynza
Maynza

Reputation: 758

How can I compile a Visual C# 2008 program that includes an access database?

I have tried creating an install file but it never includes the database in the output, I have run into this problem a few times and most of the answers I find online are too cryptic for me to wrap my head around.

Upvotes: 2

Views: 757

Answers (2)

Jorge Zuanon
Jorge Zuanon

Reputation: 1354

In the Project menu, select Add existing item, change the file type to Data Files and select your database. Then go to your project properties, in the publish tab, click the Application Files button and make sure your access file is include.

Upvotes: 3

Sam Saffron
Sam Saffron

Reputation: 131112

If you include your MDB as a resource (Properties -> Build Action -> Embedded Resource) you can extract it using: Assembly.GetExecutingAssembly().GetManifestResourceStream(name);

See here for a complete sample (that also decompresses): http://code.google.com/p/videobrowser/source/browse/trunk/MtnFrameGrabProvider/Plugin.cs

Upvotes: 1

Related Questions