Create local SQL db in ASP app

S

Steven Cheng[MSFT]

Hi Cj,

From your description, you're encountering the following error when try
creating a sql express mdf database file in VS 2005, correct?

============
Connections to sql server files (*.mdf) require sql server express 2005 to
function properly. Please verify the installation of .........
=============

Based on my experience, such behavior is likely caused by the following
things:

** SQL Express is not installed or installed with non-default instance name
rather than the default "SQLExpress" (also expected by VS 2005)

** SQL Express hasn't be configured to enable User Instance

I suggest you check the above things via the following steps:

1. Check your installed SQL Express to see whether its instance name is the
"SQLExpress" or other customized value.

2. Try connecting to other database in SQL Express through VS IDE server
explorer or SQL management studio(if you have installed) to see whether it
works

3. Try using script to check the user instance configuration in SQLExpress,
if not enabled, enable it. Here is the BOL reference about "user instance":

#Working with User Instances
http://msdn2.microsoft.com/en-US/library/ms254504.aspx

In addition, here are two web threads about the similar problem and include
some clues on checking the SQL Express instance name and the expected
instance configuration in VS 2005:

http://predicatet.blogspot.com/2007/01/connections-to-sql-server-files-mdf.h
tml

http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=124596&SiteID=1

Hope this helps.


Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead



==================================================

Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications.



Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscriptions/support/default.aspx.

==================================================



This posting is provided "AS IS" with no warranties, and confers no rights.
 
C

cj

Hi Steven,

I don't remember the setup program asking me for an instance name. It
shows as cj\sqlexpress in MS SQL Server Management Studio Express.

http://msdn2.microsoft.com/en-US/library/ms254504.aspx was too confusing
for me to understand but thankfully I had also posted in the SQL Server
group too and a Charles Wang gave me instructions to check user
instances. Sill he left out a few small things like -S after sqlcmd but
I got it to work finally. I believe user instances are enabled. I ran
"sqlcmd -S cj\sqlexpress" from the dos prompt then
1> sp_configure
2> go
config_value & run_value both show 1 for user instances enabled

Your second link http://predicatet.blogspot..... was very simple but he
said his had "SQLSERVEREXPRESS" in the SQL server instance name and he
had to leave it blank. Mine was blank but I decided to put "SQLEXPRESS"
in it. It Worked!!!!

I don't know what Visual Studio was thinking the default name was when
it was left blank but I guess it really doesn't matter.

Thank you very much for you help.

CJ
 
S

Steven Cheng[MSFT]

Thanks for your reply Cj,

Glad that you've got it working. So is the SQL express on your machine be
installed separate from Visual Studio(not install together)? Anyway, as one
of the thread has mentioned, when you want to ensure the installed SQL
Express instance matches the Visual studio's expected SQL Express
instancce, you can use the following setting in Visual Studio 2005:

Tools---> options ----> Database tools---> Data connection

Have a good day!

Steven Cheng

Microsoft MSDN Online Support Lead


This posting is provided "AS IS" with no warranties, and confers no rights.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top