converting included mdf databases to sql server 2008 databases

Jan 16, 2012 at 7:32 PM
Edited Jan 16, 2012 at 7:50 PM

Hi 

I'm trying to convert NerdDinner into using SQL Server 2008 databases (instead of using sql server express editon, my webhost provider, Surftown.dk does not support sql server express).

I'm working with the NerdDinner (Change Set 70027, the sln under the trunk folder which contains a MVC 3 Razor version).

I have created the asp.net member database inside sql server 2008, into a new database which I have named NDUsers. I have also managed to create another database inside SQL Server 2008 called NDMain and copied all tables data from Dinners.mdf to this database. 
Now when I run the applikation it runs fine until when I click "view all upcomming dinners", then I get an error stating: 
 
A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified)
 
public IQueryable<Dinner> All
{
get { return db.Dinners.Include(r => r.RSVPs); }
}
Source File:  
C:\Users\...\Documents\Visual Studio 2010\Projects\
NerdDinner 70027\Trunk\NerdDinner\Models\DinnerRepository.cs    
I have remembered to update the connection strings, to reflect changes:
Web.config
<connectionStrings configSource="connectionStrings.config">
</connectionStrings>
and
connectionString.config

<add name="ApplicationServices"
connectionString="Data Source=localhost;
Initial Catalog=NDUsers;
Integrated Security=True"
providerName="System.Data.SqlClient"/>

<add name="NerdDinnerEntities"
connectionString="metadata=res://*/Models.NerdDinner.csdl|
res://*/Models.NerdDinner.ssdl|res://*/Models.NerdDinner.msl;
provider=System.Data.SqlClient;provider connection string=&quot;
Data Source=localhost;
Initial Catalog=NDMain;
Integrated Security=True;
User Instance=False;
MultipleActiveResultSets=True&quot;"
providerName="System.Data.EntityClient"/>

I'm guessing that I have to update the code inside the DinnerRepository.cs 
file and probably also else where in the solution. But I dont know what to update or how. 

I have also looked at : Extending NerdDinner: Exploring Different Database Options,
but this article does not seem to apply to my situation.

Thanks for reading


Feb 9, 2012 at 12:07 PM

i meet the same problem,after register aspnetdb,i can login on and register user successfully.

but when i host a dinner to click the button "save",there will be error 26,so is the view mydinner.

i am confused.

Apr 4, 2012 at 4:41 PM

got the script going : http://nerddinner.codeplex.com/discussions/350171