Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1400
  • Last Modified:

Connect to sqlexpress

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
d0nMaTTi
Asked:
d0nMaTTi
1 Solution
 
Krzysztof PytkoActive Directory EngineerCommented:
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
 
HugoHiaslCommented:
Did you set up SQLExpress to accept remote connection?

This is not enabled by default....

Enable it in the Sql Server Configuration Manager
0
 
Rahul AgarwalTeam LeaderCommented:
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
Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

 
d0nMaTTiAuthor Commented:
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
 
Mohed SharfiCommented:
Hi
Please try to stop the firewall and test, if it run then Allow the SQL Server.
Hope this helpfull
Regards
0
 
d0nMaTTiAuthor Commented:
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
 
Mohed SharfiCommented:
Hi d0nMaTTi,
here you can find Configuring the Windows Firewall to Allow SQL Server Access
Best Of Luck
0

Featured Post

Technology Partners: 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!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now