Solved

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

Posted on 2010-09-03
5
849 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

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

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

Suggested Solutions

Since .Net 2.0, Visual Basic has made it easy to create a splash screen and set it via the "Splash Screen" drop down in the Project Properties.  A splash screen set in this manner is automatically created, displayed and closed by the framework itsel…
Microsoft Reports are based on a report definition, which is an XML file that describes data and layout for the report, with a different extension. You can create a client-side report definition language (*.rdlc) file with Visual Studio, and build g…
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.
Along with being a a promotional video for my three-day Annielytics Dashboard Seminor, this Micro Tutorial is an intro to Google Analytics API data.

816 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

12 Experts available now in Live!

Get 1:1 Help Now