Solved

How to use datasource with Visual Studio Express 2010 (CONTINUED...)

Posted on 2010-09-03
5
847 Views
Last Modified: 2012-05-10
Looks like I was a bit hasty in accepting the answer to the previous related question.

It says if I add my datasource (in my case VeraDB.sdf)  to my project, then the database file will be copied
to the output directory each time the project is built.

So the question then is, why is that not happening?   Using the |DataDirectory| macro SHOULD have worked,
but the program still complains it cannot find the database file.   If I manually copy the database file into the
target: C:\Documents and Settings\Al Bogus\My Documents\Visual Studio 2010\Projects\VERA\VERA\bin\Debug, then the program can find it when I debug.  But I don't get why I should have to do that.  Is that not supposed to happen automatically if Copy Always is set as a property of the Datasource?

What is it I have failed to do, then?

Thanks!
0
Comment
Question by:codefinger
  • 3
  • 2
5 Comments
 
LVL 38

Accepted Solution

by:
puppydogbuddy earned 500 total points
ID: 33602934
See this link:
          http://blogs.msdn.com/b/vsdata/archive/2010/04/13/workaround-to-data-source-window-not-populating-ria-services-domain-context-objects.aspx?PageIndex=2

the issue (a bug):  This only happens when the VS2010 is not installed in the default VS installation path. For example, if your default system root is C:\ (then the default path will be under C:\$(Program Files)\Microsoft Visual Studio 10.0...), while you install the VS2010 into D:\, then you would meet with the issue. The setup authoring in this case doesn’t install some feature assemblies into the right location.

the work-around: The workaround is to copy the feature assemblies installed into the wrong location to your machine to the right path. The feature assemblies now are always installed in your system root under $(ProgramFiles)\Microsoft Visual Studio 10.0\Common7\IDE\Extensions\Microsoft\RiaTools, which includes two folders of Data Binding and Live IntelliSense. And you’ll have to keep this folder structure and copy them into where you installed your VS2010. (An example follows in the link)  
0
 

Author Comment

by:codefinger
ID: 33603016
Nice try, but this does not apply as I used all the default installation paths.
0
 

Author Comment

by:codefinger
ID: 33603177
I deleted the VeraDB.sdf database every where I could find in on my hard drive, and deleted it from my project, then restored one copy from the recycle bin, copied it to a folder within my project, then added it to my project again.   When I built this time, the database file was copied into the bin directories and the program was able to find it using the |DataDirectory| macro.  So essentially my problem is solved, but I am curious...

When I modified data (added a new row to a table),  none of the modified file dates changed for any of the copies of the database file, even after a build.   (I was trying to determine which of four possible copies I was actually performing work on when I worked from within the IDE.)  Does the file date of the sdf file change only when one changes the structure of the database, but not when changes are made to the data it contains?
0
 
LVL 38

Expert Comment

by:puppydogbuddy
ID: 33603352
I am not 100% positive, but I believe you are correct in stating that the file date of the sdf changes only when their has been a structural change via the designer.  

As for the problem with the of the installed folders after setup , here is a problem that was reported with VS 2008 that indicates that the default install folder is the current folder.  The link also contains code to test for the existance of the sdf file in the current path.  You might want to include such a test for future installations before attempting to open the sdf file.
          http://www.daniweb.com/forums/thread163305.html
0
 

Author Closing Comment

by:codefinger
ID: 33603452
Not sure where the problem was, but it is solved, and that is what is important.
0

Featured Post

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

The ECB site provides FX rates for major currencies since its inception in 1999 in the form of an XML feed. The files have the following format (reducted for brevity) (CODE) There are three files available HERE (http://www.ecb.europa.eu/stats/exch…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

759 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now