Preparing your database

After you downloaded the source code, you must establish Coproject database.

1. Open (CoprojectSourceCodes)\db\Database.zip
2. Extract Database.mdf into \src\Coproject\Coproject.Web\App_Data
3. Double-click the file in Solution Explorer
4. It should then open Server Explorer

ServerExplorer.png

If your local SQL Express instance is running as .\SQLEXPRESS the application should be able to connect to the database now. If not, continue:
5. Hit F4 to open Properties and copy Connection String value to clipboard.

[image:DatabaseProperties.png]

6. Open Web.Config and find key CoprojectEntities under <connectionStrings>
7. Scroll to the right until you find

provider connection string=&quot;Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\Database.mdf;Integrated Security=True;User Instance=True;MultipleActiveResultSets=True&quot;

8. Replace the content between &quot; with connection string in your clipboard.
You should be able to connect to the database now.

Other database sources

You can also use \db\CreateDatabase.sql to create a database on your own. In that case, you have to update connection string in Web.config as described above. You may also remove missing link to App_Data/Database.mdf from solution.

Last edited Jan 11, 2011 at 3:52 PM by gius, version 5

Comments

No comments yet.