Solved

Connect to sqlexpress

Posted on 2011-02-18
7
1,378 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
Promote certifications in your email signature

Has your company recently won an award or achieved a certification? They'll no doubt want to show it off. Email signature images used to promote certifications & awards can instantly establish credibility with a recipient and provide you with numerous benefits.

 

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

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

This demonstration started out as a follow up to some recently posted questions on the subject of logging in: http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/Q_28634665.html and http://www.experts-exchange.com/Programming/…
New Windows 7 Installations take days for Windows-Updates to show up and install. This can easily be fixed. I have finally decided to write an article because this seems to get asked several times a day lately. This Article and the Links apply to…
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…
This tutorial will walk an individual through the steps necessary to install and configure the Windows Server Backup Utility. Directly connect an external storage device such as a USB drive, or CD\DVD burner: If the device is a USB drive, ensure i…

757 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now