?
Solved

Connect to sqlexpress

Posted on 2011-02-18
7
Medium Priority
?
1,394 Views
Last Modified: 2012-05-11
I've windows server 2008 r2 x64
When I try run web-application  it does not connect to database - anyway it does not
return data from database.
Test-webapplication uses sqlexpress database and
connectionstring= Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\test.mdf;Integrated Security=True;User Instance=True

Same problem appears if web-page tries to connect mysql server (5.5 x32)
(connectinstring: DRIVER={MySQL 5.1 Driver}; SERVER=localhost; DATABASE=testdb; UID=root;PASSWORD=79Adm1n; OPTION=3;

What kind of settings Windows 2008 x64 needs to be able to connect to database.

Matti Niskasaari
0
Comment
Question by:d0nMaTTi
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
7 Comments
 
LVL 39

Expert Comment

by:Krzysztof Pytko
ID: 34924416
Have you tried to run

cliconfg

and enable TCP/IP (set up appropriate port number - by default 1433) and Named Pipes
Enable also "Enable shared memory protocol" checkbox

check connection again. Additionally make sure that you allow inbound/outbound connection on Windows Advanced Firewall in appropriate profile.

Regards,
Krzysztof
0
 
LVL 12

Expert Comment

by:HugoHiasl
ID: 34924417
Did you set up SQLExpress to accept remote connection?

This is not enabled by default....

Enable it in the Sql Server Configuration Manager
0
 
LVL 13

Expert Comment

by:Rahul Agarwal
ID: 34924852
Enable TCP/IP (set up appropriate port number - by default 1433) and Named Pipes
Enable also "Enable shared memory protocol" checkbox.

Additionally make sure that you allow inbound/outbound connection on Windows Advanced Firewall in appropriate profile.

And Make sure that the SQL Express Service is running on Services Section in Administrative tools.
0
Is Your AD Toolbox Looking More Like a Toybox?

Managing Active Directory can get complicated.  Often, the native tools for managing AD are just not up to the task.  The largest Active Directory installations in the world have relied on one tool to manage their day-to-day administration tasks: Hyena. Start your trial today.

 

Author Comment

by:d0nMaTTi
ID: 34926436
I did run cliconfg.exe and also did changes to tcp/pi and nameb pipes but
web-page couldn't connect to sqlexpress database.

Next i did simple wpf-application and installed to server.
When I did run testprogram first there came error message (convert version 611 to 650.. 612 to 650 and so on) but after that connection succeed - in particular using wpf application.
But when I try to connect same database from webpage i'll get error:

Failed to generate a user instance of SQL Server due to failure in retrieving the user's local application data path. Please make sure the user has a local user profile on the computer. The connection will be closed.
0
 
LVL 7

Expert Comment

by:Mohed Sharfi
ID: 34932609
Hi
Please try to stop the firewall and test, if it run then Allow the SQL Server.
Hope this helpfull
Regards
0
 

Author Comment

by:d0nMaTTi
ID: 34933321
Hi

i tried also firewall but it dit not affected this.
I dont understand that error message which refers to local user profil.

"Additionally make sure that you allow inbound/outbound connection on Windows Advanced Firewall in appropriate profile."
- I'm not sure about thos rules - which of those rules could influence to data transer


0
 
LVL 7

Accepted Solution

by:
Mohed Sharfi earned 2000 total points
ID: 34934574
Hi d0nMaTTi,
here you can find Configuring the Windows Firewall to Allow SQL Server Access
Best Of Luck
0

Featured Post

Has Powershell sent you back into the Stone Age?

If managing Active Directory using Windows Powershell® is making you feel like you stepped back in time, you are not alone.  For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
For anyone that has accidentally used newSID with Server 2008 R2 (like I did) and hasn't been able to get the server running again because you were unlucky (as I was) and had no backups - I was able to get things working by doing a Registry Hive rec…
This tutorial will walk an individual through locating and launching the BEUtility application to properly change the service account username and\or password in situation where it may be necessary or where the password has been inadvertently change…
There are cases when e.g. an IT administrator wants to have full access and view into selected mailboxes on Exchange server, directly from his own email account in Outlook or Outlook Web Access. This proves useful when for example administrator want…

719 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question