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
Solved

Connect to sqlexpress

Posted on 2011-02-18
7
1,383 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
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
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

 

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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

If you migrate a Terminal Server licenses server inside the 2008 server family, you can takte advantage of the build-in migration tool. If you like to migrate an older 2003 Server (and the installed client CALs) to a 2008 R2 server for example, you …
You might have come across a situation when you have Exchange 2013 server in two different sites (Production and DR). After adding the Database copy in ECP console it displays Database copy status unknown for the DR exchange server. Issue is strange…
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 walk an individual through the steps necessary to join and promote the first Windows Server 2012 domain controller into an Active Directory environment running on Windows Server 2008. Determine the location of the FSMO roles by lo…

839 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