Solved

Connect to sqlexpress

Posted on 2011-02-18
7
1,384 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:agarwalrahul
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
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

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 500 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

Suggested Solutions

Scenario:  You do full backups to a internal hard drive in either product (SBS or Server 2008).  All goes well for a very long time.  One day, backups begin to fail with a message that the disk is full.  Your disk contains many, many more backups th…
Background Information Recently I have fixed file server permission issues for one of my client. The client has 1800 users and one Windows Server 2008 R2 domain joined file server with 12 TB of data, 250+ shared folders and the folder structure i…
This tutorial will give a short introduction and overview of Backup Exec 2012 and how to navigate and perform basic functions. Click on the Backup Exec button in the upper left corner. From here, are global settings for the application such as conne…
This tutorial will show how to configure a single USB drive with a separate folder for each day of the week. This will allow each of the backups to be kept separate preventing the previous day’s backup from being overwritten. The USB drive must be s…

740 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