6

I have installed SQL Server 2012 and LocalDB on my development machine, and am able to connect to LocalDB using both the SQL Server Management tool 2012 and from within my winform application using a newly modifed connection string Shown below:

Data Source=(LocalDB)\v11.0;AttachDbFilename=|DataDirectory|\MyDatabase.mdf;Integrated Security=True;Connect Timeout=60

The problem arises when I attempt to port my application onto a Windows 2008 Server which is running SQL Server 2008, (I know I could skip the LocalDB installation and just make use of SQL Server 2008, but I am just testing the installation of my application on this machine.. )

I have installed both SQL Server 2012 LocalDB and updated .net 4.01 to .net 4.02 using the kb article located at http://support.microsoft.com/kb/2544514

I keep getting getting an error when I attempt to connect to (LocalDB)\v11.0 from both my application and from the SQL Server Management 2008 Tool, I have also manually started up (LocalDB)\v11.0 from cmd->SQLLocalDB -s "v11.0" and then attempted to connect once again using the NP

i.e np:\\.\pipe\LOCALDB#8B2C7490\tsql\query

When I use the named pipe everything connects fine, so I am assuming that as this works then the installation of LocalDB is also correct.

What do you suggest I do to resolve this situation?

I am also concerned as to the proper implementation moving forward with the deployment of my application, am I supposed to now include .Net 4.03 as a prerequisite? If so is there already a clickonce bootstrap manifest available for this or do I need to create one.. so that my app works correctly moving forward, I'm really concerned that LocalDB might break it.. as so far I'm not having much luck..

I guess if all else fails I can go back to using SQL Server Express 2008 as this implementation worked correctly before..

Thanks,

migrated from stackoverflow.com Jun 14 '12 at 12:02

This question came from our site for professional and enthusiast programmers.

2

From what I could see, it appears that Microsoft doesn't support LocalDb out of the box in Windows Server 2008. I just got the Web Platform Installer and tried searching for localdb and no entries were found. I went to the download site and grabbed only the LocalDb.msi installer and installed it in Win Server 2008. Created a default instance:

C:\Program Files\Microsoft SQL Server\110\Tools\Binn>sqllocaldb.exe c "v11.0" -s

Then tried to connect to it in my ASP.NET MVC 4 app but it didn't work. This works in Windows 8 RC.

I simply decided to go with SQL Express 2008 since this one the Web Platform Installer found!

2

The problem is not in Windows Server version but in .NET Framework version. You mention you are using SQL Server 2008 Management Studio, which is using .NET 3.5. So updating .NET 4 to .NET 4.0.2 will have no effect on it - you would need to update .NET 3.5.

Install SQL Server 2012 Management Studio, make sure .NET 4 is updated to .NET 4.0.2 and you will see that it works just fine on Windows Server 2008.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy