Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

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

Posted on 2010-09-03
5
Medium Priority
?
855 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
5 Comments
 
LVL 38

Accepted Solution

by:
puppydogbuddy earned 2000 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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Introduction As chip makers focus on adding processor cores over increasing clock speed, developers need to utilize the features of modern CPUs.  One of the ways we can do this is by implementing parallel algorithms in our software.   One recent…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
Suggested Courses

610 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