getting started

getting started

Old forum URL: forums.lhotka.net/forums/t/3584.aspx


rb157 posted on Monday, September 24, 2007

I've downloaded the c# code built the CSLA code, changed the connection string to the directory which the code was downloaded to and run the Project tracker application. login as pm, pm.

I then receive a DataPortal exception:

"An attempt to attach an auto-named database for file C:\\Documents and Settings\\Richard Box\\My Documents\\Visual Studio Projects\\csla20\\ProjectTracker20cs\\Security.mdf failed. A database with the same name exists, or specified file cannot be opened, or it is located on UNC share."

I am using PTWin as my startup project as the easiest option to begin, and have I believe followed Rocky's instructions to the letter, only making changes for the PTWin project.

Any help in resolving this and therefore getting on with using the framework, greatly appreciated.

Many Thanks,

Richard

 

 

RockfordLhotka replied on Monday, September 24, 2007

Those double \\ seem suspicious don't they?

rb157 replied on Monday, September 24, 2007

Thanks Rocky, yes they do seem strange, as they are single in the connection string:

<connectionStrings>
    <add name="PTracker"
    connectionString="Data Source=.\SQLEXPRESS;AttachDbFilename=C:\Documents and Settings\Richard Box\My Documents\Visual Studio Projects\csla20\ProjectTracker20cs\PTracker.mdf;Integrated Security=True;User Instance=True"
    providerName="System.Data.SqlClient" />
    <add name="Security"
    connectionString="Data Source=.\SQLEXPRESS;AttachDbFilename=C:\Documents and Settings\Richard Box\My Documents\Visual Studio Projects\csla20\ProjectTracker20cs\Security.mdf;Integrated Security=True;User Instance=True"
    providerName="System.Data.SqlClient" />
  </connectionStrings>

However, I have done some further investigation and found that I could not attach in Sql Server Management Studio to the directory where the dbs reside.

I have now moved the databases to the SQL Server data directory, amended the connection string and all is well.

Many Thanks,

Richard

Copyright (c) Marimer LLC