?
Solved

vb.net "retrieve property setting"  Path to database

Posted on 2012-09-05
14
Medium Priority
?
519 Views
Last Modified: 2012-10-26
When I began new app, I let vb.net store a copy of my database in local folder.  Problem now is, when I compile the project, it puts the database in the "release" folder, and MyApp.exe looks for it there, instead of on the server.

The setting for this are in in Solution explorer - my Project - under the Settings tab.
I've included a JPG file showing this screen.

Question:
How do I undo this?  If I merely delete it on this screen, I get 5-10 program errors.
Any clean way to remove this alternate path to "HMDP" and let program find it in Q:\MechDesign\Databases?

Thanks Much,  Lbiederman
0
Comment
Question by:Larry Biederman
  • 8
  • 5
13 Comments
 
LVL 83

Expert Comment

by:CodeCruiser
ID: 38371342
No screenshot attached

>it puts the database in the "release" folder, and MyApp.exe looks for it there, instead of on the server.

Can you clarify?
0
 

Author Comment

by:Larry Biederman
ID: 38372134
Sorry, screen shot attached now.
If you look at JPG attached, you'll see that HMDP.mdb is both on the server (Q:\ drive) and is saved locally on C: drive.  This is because when you add a new dataset, it asks if you want to keep a local copy of the database.

Problem is, the EXE file only looks for the local copy which is written out to the release folder (where compiled runtime stuff is written).  Now, it never looks for it on server, only in compiled folder.

So, I need to delete the last line on screen shot, and all associated code in piorgram.
But if you just delete in screen shot, you get 5-10 errors.

SO........  How is this properly accomplished?

Thanks, Larry


Thanks, Larry
RetrievePropertySettings.jpg
0
 
LVL 83

Expert Comment

by:CodeCruiser
ID: 38388709
You can just change the connection string (path of the file) in that last line. Or search for that setting name in  your solution and replace it with correct one.
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:Larry Biederman
ID: 38443644
CodeCruiser,

I have been away for 2 weeks.
I thank you for reply, and apologize for lack of response.

I will try your advice tomorrow, and respond/reward points.

Thanks for help,
Larry
0
 

Author Comment

by:Larry Biederman
ID: 38451213
CodeCruiser,

Well I tried to remove all references in code, but found it difficult to differentiate the 2 references.  So, I deleted the 'my projects - settings reference, then deleted the entire HMDPdataset.sxd.  Then added HPMD.meb back in, but this time did NOT ask it be included in the local directory.
This Works!
 Only minor issue is that HMDP.mdb is still included into the bin folder.
Although it’s no longer referenced, and can be deleted.

================================

SO, how do I stop it from being included into the bin folder output, when I rebuild the solution?

-Thanks, Lbiederman
0
 
LVL 83

Assisted Solution

by:CodeCruiser
CodeCruiser earned 300 total points
ID: 38456711
Select the mdb file and then open properties. Change the Build Action as desired.
0
 

Author Comment

by:Larry Biederman
ID: 38464464
CodeCruiser,

Please be more specific.  Select the mdb file....... where?

-Thanks, Lbiederman
0
 
LVL 83

Expert Comment

by:CodeCruiser
ID: 38473898
In solution explorer.
0
 

Author Comment

by:Larry Biederman
ID: 38516179
Code Cruiser,
Contrary to your last brief comment, solution explorer does NOT contain any databases, only datasets.

For all the points, you need to provide the specific navigation path.
Again, I'm trying to eliminate placing the *.mdb file in the compiled bin\release folder, so the completed app looks for the *.mdb database in the folder on server, and NOT in the release folder.

Please give specific instructions, then I'll give points.

Thanks, Larry
0
 
LVL 83

Expert Comment

by:CodeCruiser
ID: 38518709
You need to add the MDB file to the solution first

Another option is to not deal with MDB in VS. Just copy it to the folder where your exe is and just use filename without full path in your connection string.
0
 

Accepted Solution

by:
Larry Biederman earned 0 total points
ID: 38519473
CodeCruiser,  
Sorry if my question is confusing.
What I need to do  is reverse the apps path to a database (dataset) that is local, and revert to main location/copy.

Here is a solution I found that works:

1- delete the xsd file for this database.  Then recreate it, but say NO when asked if you want database to be stored locally.

2- delete the database from solution explorer, if present.

3- double click my project, in solution explorer.  Select settings.  right click in far left column in row showing local setting for this database (note, it will be listed twice-- once for location in database, and another listing for the local copy).  Select 'remove setting".

I've repeated this now three times, and it works.

-Larry
0
 

Author Comment

by:Larry Biederman
ID: 38519482
I'll allow moderator to complete.  I do not want points.
 Just wanted to note the advice I received from others, although greatly appreciated, did not resolve.

For benefit of other members, I have shared my successful solution found elsewhere.

Thanks,
Lbiederman
0
 

Author Closing Comment

by:Larry Biederman
ID: 38537810
I have found a solution that works on my own. Advice here, though greatly appreciated was sketchy, and did not lead  to resolution.

Thanks for help, CodeCruiser
0

Featured Post

 [eBook] Windows Nano Server

Download this FREE eBook and learn all you need to get started with Windows Nano Server, including deployment options, remote management
and troubleshooting tips and tricks

Question has a verified solution.

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

In my previous two articles we discussed Binary Serialization (http://www.experts-exchange.com/A_4362.html) and XML Serialization (http://www.experts-exchange.com/A_4425.html). In this article we will try to know more about SOAP (Simple Object Acces…
Simulator games are perfect for generating sample realistic data streams, especially for learning data analysis. It is even useful for demoing offerings such as Azure stream analytics, PowerBI etc.
Please read the paragraph below before following the instructions in the video — there are important caveats in the paragraph that I did not mention in the video. If your PaperPort 12 or PaperPort 14 is failing to start, or crashing, or hanging, …
Loops Section Overview
Suggested Courses

840 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