Very Newbie Having TroubleVery Newbie Having Trouble
Old forum URL: forums.lhotka.net/forums/t/1805.aspx
IraD posted on Tuesday, November 21, 2006
Help!
I have just downloaded CSLA .NET and gotten the sample application to build.
When I start the Web application, I get the forms authentication box and I fill it in. Then I get an error from DataPorta.Fetch saying "an attempt to attach an auto-named database for file C:\CSLA\csla20\ProjectRacker20vb\Security.mdf failed. A database with the same name exists or specified file can not be opened or it is located on UNC share".
When I look it Windows Explorer my database is there......
Any ideas are welcome. I'm really looking forward to CSLA, but I need to get off square 1. Thanks!
Bayu replied on Tuesday, November 21, 2006
I have no experience in using mdf-datafiles directly from disk, so my answer may be a little more laborious than strictly necessary:
- get Microsoft\'s SqlServer Management Studio Express
- this tool will allow you to manage your local data sources
- attach the mdf files (both of them) to your system
- (quick and dirty, but certainly not a best practice for client installations) give your ASPNET and IUSR_<your-pc-name> ownership rights to both DBs
- modify the both connection strings of your Remotinghost and/or Webservicehost into something like this:
Data Source=.\SQLEXPRESS;Initial Catalog=<databasename>;Integrated Security=True
You can find these settings in the Web.Config or App.Config files of the respective projects.
Hope this gets you to square 2,
Bayu
xal replied on Tuesday, November 21, 2006
The problem is that this procedure "attaches" the DBs to your sql server instance.
You probably have a database named "Security" in your sql server instance. You could attach the db with another name and change the connection strings so that it won't conflict with your existing ones.
You can do this by hand in you sql server management studio and then change the connection strings to use connect to your instance as you do regularily.
Andrés
IraD replied on Tuesday, November 21, 2006
Yes, more or less, this is what I have done. Now I am on to step 2!
The Windows app works!!!
I have copied the databases into App_Data.
The Web app gets a data portal error immediately after apparently succesful login - "DataPortal.Fetch (Of PTIdentity) (New Criteria(Username,password))" fails saying it's an invalid instance.
Hmmm...
Copyright (c) Marimer LLC