?
Solved

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

Posted on 2010-09-03
5
Medium Priority
?
853 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

Want to be a Web Developer? Get Certified Today!

Enroll in the Certified Web Development Professional course package to learn HTML, Javascript, and PHP. Build a solid foundation to work toward your dream job!

Question has a verified solution.

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

Introduction When many people think of the WebBrowser (http://msdn.microsoft.com/en-us/library/2te2y1x6%28v=VS.85%29.aspx) control, they immediately think of a control which allows the viewing and navigation of web pages. While this is true, it's a…
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
Michael from AdRem Software outlines event notifications and Automatic Corrective Actions in network monitoring. Automatic Corrective Actions are scripts, which can automatically run upon discovery of a certain undesirable condition in your network.…
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…

752 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