New Posts New Posts RSS Feed: Can't access NorthWindIB in ASPAuthentication example for ASP security
  FAQ FAQ  Forum Search   Calendar   Register Register  Login Login

Can't access NorthWindIB in ASPAuthentication example for ASP security

 Post Reply Post Reply
Author
BruceKu View Drop Down
Newbie
Newbie
Avatar

Joined: 09-Jan-2010
Location: Canada
Posts: 7
Post Options Post Options   Quote BruceKu Quote  Post ReplyReply Direct Link To This Post Topic: Can't access NorthWindIB in ASPAuthentication example for ASP security
    Posted: 22-Jan-2010 at 2:18pm
I am in general having problems getting your samples to find the NorthWindIB database.
 
I used your Database Installer tool but that hasn't helped.
 
This is your security example that requires login and includes registration.
 
To solve datbase connection problems in this case I put both the aspnetdb.mdf and NorthWindIB.mdf in the App_Data directory.
 
Then I modified the web.config as follows: ( I list only moded parts- find BRUCELAPTOP etc)
 

<edmKey name="Default" connection="metadata=res://*/Code.ServerModelNorthwindIB.csdl|res://*/Code.ServerModelNorthwindIB.ssdl|res://*/Code.ServerModelNorthwindIB.msl;provider=System.Data.SqlClient;provider connection string=&quot;Data Source=BRUCELAPTOP\SQLEXPRESS;Initial Catalog=NorthwindIB;Integrated Security=True;MultipleActiveResultSets=True&quot;" containerName="AspAuthentication.Code.ServerModelNorthwindIBContext">

and

<add name="ServerModelNorthwindIBContext" connectionString="metadata=res://*/Code.ServerModelNorthwindIB.csdl|res://*/Code.ServerModelNorthwindIB.ssdl|res://*/Code.ServerModelNorthwindIB.msl;provider=System.Data.SqlClient;provider connection string=&quot;Data Source=BRUCELAPTOP\SQLEXPRESS;AttachDbFilename=|DataDirectory|\NorthwindIB.mdf;Integrated Security=True;Connect Timeout=30;User Instance=True;MultipleActiveResultSets=True&quot;" providerName="System.Data.EntityClient" />

 
I then opened the NorthWindIB data base using server explorer.
 
Then I connected for update the EF model to the same database.
 
I then went into domain model and regenerated it.
 
I can logon successfully to manager using login window.
 
When I press Fetch button I get the message
 
Cannot open database "NorthwindIB" requested by the login. The login failed.
Login failed for user 'IRDM\bruce'.
 

<!-- Forms authentication is used here. -->

<authentication mode="Forms" />

I am not sure what to do next.
 
Any ideas? (IRDM is my network domain in active directory)
Bruce
Back to Top
kimj View Drop Down
IdeaBlade
IdeaBlade
Avatar

Joined: 09-May-2007
Posts: 1391
Post Options Post Options   Quote kimj Quote  Post ReplyReply Direct Link To This Post Posted: 23-Jan-2010 at 6:12pm
DevForce actually looks at only the EdmKeys for connection information, ignoring the connectionStrings section of your config file.  To get DevForce to open the NorthwindIB database in the Data directory you'll need to make a few more changes to the EdmKey's connection string to make it correct for SQLExpress (DevForce samples, and the installation, assume a non-Express version of SQL Server).  It should look like this:
 
edmKey name="Default" connection="metadata=res://*/Code.ServerModelNorthwindIB.csdl|res://*/Code.ServerModelNorthwindIB.ssdl|res://*/Code.ServerModelNorthwindIB.msl;provider=System.Data.SqlClient;provider connection string=&quot;Data Source=BRUCELAPTOP\SQLEXPRESS;;AttachDbFilename=|DataDirectory|\NorthwindIB.mdf;Integrated Security=True;Connect Timeout=30;User Instance=True;MultipleActiveResultSets=True&quot;" containerName="AspAuthentication.Code.ServerModelNorthwindIBContext">
Back to Top
BruceKu View Drop Down
Newbie
Newbie
Avatar

Joined: 09-Jan-2010
Location: Canada
Posts: 7
Post Options Post Options   Quote BruceKu Quote  Post ReplyReply Direct Link To This Post Posted: 25-Jan-2010 at 1:31pm
Thank you!
 
That did the trick.
 
I appreciate the explanation of the structure. I should find it easier with the rest of your examples.
 
Bruce
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down