SQL Server Error 26: Error Locating Server/Instance Specified

Recently I installed Visual Studio 2005 (Release Candidate) at my home computer to explore a new feature of C# 2.0 : WebParts. When I compiled my WebPart demo and tried to run it, the following error was presented to me:

error locating server/instance specified

After doing some searching I discovered that the source of this problem could be found in the machine.config file. In the machine.config you'll find a connectionstring with the name 'LocalSqlServer'.

wrong connection string

The problem with this autogenerated connectionstring is that it assumes that I had an instance of SQL Server 2005 Express Edition installed, when in fact I am running an instance of good ol' SQL Server 2000. So the solution to this problem is to change the current connection string in machine.config into the proper connection string. If you have the same problem as I did, but don't have acces to the machine.config, you can solve this problem by adding the following lines to the web.config of your application (off corse you'll first have to replace the dots with real values):

<connectionStrings>
   <remove name="LocalSqlServer"/>
   <add name="LocalSqlServer" connectionString=".." providerName=".." />
</connectionStrings>

When I tried to run my WebPart demo agian, I was presented with an error indicating that the aspnet_CheckSchemaVersion stored procedure could not be found.

error could not find stored procedure

The solution for this problem is provided by Microsoft self. They provided a SQL Server Setup wizard which will solve all your problems.

sql server setup wizard

This wizard can be found at C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\ and is named aspnet_regsql.exe. All you have to do during the steps of this wizard is to select your SQL instance and your database and the wizard will take care of the rest. When I tried to run my WebPart demo again everything runned smoothly.

Published Thu, Feb 9 2006 10:07 PM by Arjen Bloemsma
Filed under:

Comments

# re: SQL Server Error 26: Error Locating Server/Instance Specified

Tuesday, February 21, 2006 1:02 PM by Swarna
Thankyou!!
It really helped

Swarna

# re: SQL Server Error 26: Error Locating Server/Instance Specified

Tuesday, March 14, 2006 8:24 PM by Jason
Helped me too! Thanks!

# re: SQL Server Error 26: Error Locating Server/Instance Specified

Wednesday, March 15, 2006 12:51 PM by Orhan
Hi, I'd installed SQL server 2005 express edition on my server and I had no problem wit connecting it remotely through Management Studio, then I removed it and installed a 6 moths trial full edition SQL server 2005. That's when it's all gone wrong.

I have access to my machine.config file and it goes like this.

<connectionStrings>
<add name="LocalSqlServer" connectionString="data source=.\SQLEXPRESS;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|aspnetdb.mdf;User Instance=true" providerName="System.Data.SqlClient"/>
</connectionStrings>

any idea how I should change this in order to be able to remotely connect to SQL Server Using Management Studio?

I have tried running .Net Sql server wizard on the server but it didn't connect probably for the same reasons why I cant connect remotely.

Any ideas? Thanks.

# re: SQL Server Error 26: Error Locating Server/Instance Specified

Friday, April 21, 2006 10:01 AM by pasan
Finally I was able to fix the probs i had with web parts using yr help! Thanks alot

# re: SQL Server Error 26: Error Locating Server/Instance Specified

Wednesday, June 07, 2006 11:23 AM by PB
AWESOME!
That did it.

# re: SQL Server Error 26: Error Locating Server/Instance Specified

Wednesday, November 22, 2006 6:02 AM by mrclash

Thanks man!! I was stuck with that for many hours. This worked!!

# re: SQL Server Error 26: Error Locating Server/Instance Specified

Thursday, November 23, 2006 8:09 AM by John

Absolutely brilliant.

Why should we have to go through all this rigmarole in this day and age ?

Thanks again

John

# re: SQL Server Error 26: Error Locating Server/Instance Specified

Thursday, February 08, 2007 3:26 AM by ASHA

WOW  

It really worked..thank u

# re: SQL Server Error 26: Error Locating Server/Instance Specified

Thursday, March 01, 2007 5:54 AM by dotnetforce

Thanks Arjen Bloemsma. I got mine working now.

# re: SQL Server Error 26: Error Locating Server/Instance Specified

Wednesday, March 07, 2007 1:18 AM by Shyam S

Thanks a lot.... Its really a good post...

# re: SQL Server Error 26: Error Locating Server/Instance Specified

Sunday, March 11, 2007 8:19 AM by Snooze

Me also man, good job...

# re: SQL Server Error 26: Error Locating Server/Instance Specified

Wednesday, March 14, 2007 10:06 AM by Nik

I get the same message while connecting to a remote server windows 2003/ Sql server 2005 from home ( with sql 2005 express ) in order to test merge replication.

I have the ip address for the remote server and can login there with remote desktop.

Can anyone help?

# re: SQL Server Error 26: Error Locating Server/Instance Specified

Wednesday, May 23, 2007 12:11 AM by MK

I am trying to connect to the remote sql server 2005 from my client. This error message is displayed.

# re: SQL Server Error 26: Error Locating Server/Instance Specified

Wednesday, July 18, 2007 9:45 PM by Chrezx

thank you very much, it took me hours to find this. my scenario was when i  upgraded from express to other sql server editions.

# re: SQL Server Error 26: Error Locating Server/Instance Specified

Thursday, August 09, 2007 2:52 PM by Thanks

Helps me lot!! Great!!

# re: SQL Server Error 26: Error Locating Server/Instance Specified

Saturday, September 29, 2007 2:05 AM by Sri Manoj

I too have the same problem, n couldn't resolve yet...

Please post the complete connection string example I can look at.

# re: SQL Server Error 26: Error Locating Server/Instance Specified

Wednesday, November 28, 2007 2:31 PM by ICQManZ

Prodaiy ICQ za 12$ za vse.Ïðîäàþ ICQ 12$ çà âñå.

274-693

324-994

564-567

605-800

695-769

985-425

132-335

478-575

Sviaz so mnoi ICQ 458411483. Ñâÿçü ñî ìíîé ICQ 458411483

# re: SQL Server Error 26: Error Locating Server/Instance Specified

Wednesday, November 28, 2007 10:57 PM by Javier Callico

I had a similar problem when connecting to a SQL Server 2000 from a .NET 2.0 web application.

Please see if this helps:

www.callicode.com/.../Default.aspx

# re: SQL Server Error 26: Error Locating Server/Instance Specified

Sunday, December 23, 2007 9:15 PM by Immanuel

Great deal.. it worked fine....

# re: SQL Server Error 26: Error Locating Server/Instance Specified

Saturday, February 02, 2008 5:10 PM by hrishikesh joshi

Thank you so much.

I was googling the internet for about 2 days before i finally changed my search string in google and came across this blog.

It makes perfect sense: i installed visual studio 2005 professional and by default it installs sql server express edition with it. How ever i wanted to install sql server 2005 developers edition on my machine (winxp sp2). So i first uninstalled all the sql server components from add remove programs (i basically un installed every thing that had sql prefix to it) and then installed sql server 2005 dev edition.

Later when developing a page in VS2005, i used webparts but when i tried to compile and run , i used to get sql error 26 cannot find named instance thing.

the machine.config fix in this post made perfect sense. It was still hungover its previous installation of sqlserver while i was trying to use the newer installed one. I fixed it as mentioned in this blog and vola!... my application is up and running.

Thanks mate.

# re: SQL Server Error 26: Error Locating Server/Instance Specified

Tuesday, February 26, 2008 1:52 PM by Mohammad and Shadi

thanks  for solving this problem

you are the only one thats provide the correct solution among the internet

thanks again

# re: SQL Server Error 26: Error Locating Server/Instance Specified

Friday, April 04, 2008 2:55 AM by Ghost

Hi

I have this problem but what should i put instread of data source=.\SQLEXPRESS; plz help me out thanks

GHOSTS

# re: SQL Server Error 26: Error Locating Server/Instance Specified

Wednesday, April 23, 2008 4:00 PM by AB

In my Web Application, "LocalSqlServer" connection string does not exist in Web.config, or anywhere else. It must be implied or somewhere I haven't found.

Nevertheless, to find it where ever it is stored, instead of editing a config file, do the following: -

o Go into IIS Manager

o Right click your application and select properties

o Select the ASP.NET tab

o Click "Edit Configuration" button

Voila! In the General Tab | Connection String Manager section, there should be a LocalSQLServer connection string, you should edit to connect to your chosen server and database.

BTW: Thanks for the server setup wizard tip. MS suck at everything, including providing good information.

# re: SQL Server Error 26: Error Locating Server/Instance Specified

Wednesday, April 23, 2008 4:39 PM by AB

Caveat.

For me, the LocalSQLServer setting was in the ASP.NET global config.

You can set this in your application by adding the following to your <connectionStrings> section: -

<remove name="LocalSqlServer"/>

<add name="LocalSqlServer" connectionString="... Your connection string ..."/>

# re: SQL Server Error 26: Error Locating Server/Instance Specified

Friday, April 25, 2008 12:00 PM by santhosh

it was very bad idea

# re: SQL Server Error 26: Error Locating Server/Instance Specified

Friday, May 16, 2008 3:09 PM by hiq

hiq like

# re: SQL Server Error 26: Error Locating Server/Instance Specified

Friday, May 23, 2008 3:52 AM by Jayson

Thank you SO much!  This problem was so frustrating, but your solution fixed everything!

# re: SQL Server Error 26: Error Locating Server/Instance Specified

Friday, May 30, 2008 7:27 AM by BeddySweava

<a href=docs.google.com/Doc at this...</a>

# re: SQL Server Error 26: Error Locating Server/Instance Specified

Monday, June 02, 2008 8:52 AM by BeddySweava

<a href=docs.google.com/Doc, it is here...</a>

# re: SQL Server Error 26: Error Locating Server/Instance Specified

Thursday, June 12, 2008 4:40 AM by Pedro

Very good indeed, Thanks!!

# re: SQL Server Error 26: Error Locating Server/Instance Specified

Sunday, August 03, 2008 7:11 PM by Firman_62

Aktifkan account emailku

# re: SQL Server Error 26: Error Locating Server/Instance Specified

Sunday, August 17, 2008 3:58 PM by Shaheen and Ramzi

It works Wonderfully thanks

# re: SQL Server Error 26: Error Locating Server/Instance Specified

Monday, October 20, 2008 1:02 AM by Neil Sachanandani

YOU ARE THE MAN! THANKS FOR SHOWING HOW TO DO THIS! w00T!

# re: SQL Server Error 26: Error Locating Server/Instance Specified

Saturday, November 15, 2008 5:38 PM by Netbeans

Had the same problem. thanks good work.

# re: SQL Server Error 26: Error Locating Server/Instance Specified

Monday, December 01, 2008 9:28 PM by Akhila

Thank you! You have been a great help.

# re: SQL Server Error 26: Error Locating Server/Instance Specified

Thursday, December 04, 2008 3:23 AM by idowu

slow and site not opening

# re: SQL Server Error 26: Error Locating Server/Instance Specified

Friday, December 05, 2008 12:08 PM by Sagar

I am having sql 2000 in my system and I intsalled sql 2005 in the same machine with a named instance.

After that when i am trying to login into sql 2005 from managment studio its throwing the below error :

An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connection. (provider: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified)

please help me...

# Ламинат

Friday, December 05, 2008 5:57 PM by nopBoigenihok

Портал строительных материалов: плинтусы.

Пластиковая вагонка - это практичный способ отделки стен и потолков любых помещений, сочетающий в себе декоративность, экономичность и простоту монтажа.

<a href=skuper.ru/makers.php подложка</a>

<a href=skuper.ru/collections.php ПВХ 3м</a>

Onduline или Ондулин – марка еврошифера, выпускаемого одноименной французской корпорацией уже более 50 лет.

<a href=skuper.ru/makers.php (Канада)</a>

<a href=skuper.ru/sect_about.php

Заходите

<a href=http://skuper.ru>Skuper</a>

<a href=http://skuper.ru>Skuper</a>

# re: SQL Server Error 26: Error Locating Server/Instance Specified

Sunday, December 07, 2008 1:44 PM by mohammad

hi ,,

it doesn't work with the F***in vista... :'(

# Все о строительстве

Thursday, December 11, 2008 2:45 AM by veltepheboupt

Грязь, обладая абразивными свойствами, непременно разрушает все напольные покрытия, сокращая срок его службы. И, как ни странно, в нашей стране, где девять месяцев в году дождь чередуется со снегом, ничего, кроме традиционно устанавливаемы перед входом металлических решеток, обладающих нулевой эффективностью, и куцых ковриков у входных дверей, со временем становящимися дополнительным источником загрязнения, не используется.

<a href=http://stroi-mk.ru>Все о строительстве полезные материалы</a>

Кирпич Кирпич - прочный и долговечный материал. Бывает красный кирпич на основе глиняного сырья и белый - силикатный. Срок службы кирпичных строений на надежных фундаментах почти не ограничен. Красный кирпич - самый древний из искусственных материалов. Красный кирпич Красный кирпич - результат обжига прессованых глиняных брикетов. Исключительно широко и давно используются в строительстве при устройстве фундаментов, стен и перегородок, кладке печей, заборов.

<a href=http://construct-m.ru>construct-m</a>

# Все о автомобилях

Sunday, December 14, 2008 5:26 PM by loofchini

Апгрейд для Ferrari 599 GTB включает в себя молдернизацию двигателя, подвески и экстерьера автомобиля.

<a href=http://bs-avto.ru>се об авто</a>

Сегмент представимтельских седаан в ближайшее время ждут существенные изменения. В этом году обществоо BMW представила новое поколение своего флагмана - седана 7 Series. Похоже, не за горами обновления и у конкурентов. И что Mercedes-Benz готови лишь небольшой феслифтинг S-Klass, специалисты Audi решили полностью обновить седан А8.

<a href=http://bs-avto.ru>Ауди</a>

Специалисты тюнинг-ателье поработали над усовершенствованием серийных дигателей, в результате 3L TDI  двигатель мощностью 225 л.с. "разогнали" предварителльно 270 л.с, 2.5L TDI - с 174 л.с. до 195 л.с., а 5-литровый V10 дизельный движок с 313 л.с. прежде 360 л.с.

<a href=http://bs-avto.ru>bs-avto</a>

# чотавот

Saturday, December 20, 2008 11:14 AM by spichmararm

Разместил это на своем блоге с ссылкой на ваш сайт. Надеюсь, Вам это какую-нибудь пользу принесет :)

# такая темка

Saturday, December 20, 2008 2:05 PM by Fienseavawn

Занятно-занятно, нигде раньше на такое не натыкался.

# темка-темка

Saturday, December 20, 2008 4:55 PM by Dieweesee

Подписался на Ваш блог, а в рсс какие-то закорючки. Проверьтке кодировку чтоль.

# сися

Saturday, December 20, 2008 9:00 PM by effilillavile

Круто. И не поспоришь ведь :)

# ладушки

Sunday, December 21, 2008 1:43 AM by NuffPrege

Занятно-занятно, нигде раньше на такое не натыкался.

# драсте

Sunday, December 21, 2008 8:06 AM by Televerwera

Да, жаль, что обновления на блоге происходят не так часто, как хотелось бы.

# лом4354вап

Sunday, December 21, 2008 2:15 PM by Assoneexter

Знакомый посоветовал зайти на этот блог и явно не зря.

# хорошо4354авпп

Sunday, December 21, 2008 9:16 PM by GackVittica

Кинули сегодня в аське ссылку на эту новость - не жалею, что потратил время и перешел:)

# wererw53fdgvfv

Monday, December 22, 2008 2:35 PM by MuffelowesTew

Интересно, а почему так редко блог обновляете?

# dfsgdfg454554fdgfg

Monday, December 22, 2008 9:32 PM by ElerlyHooke

Надеюсь, остальные записи окажутся такими же интересными :)

# 3244ret4354

Tuesday, December 23, 2008 3:54 AM by Murbensunny

Пропущено несколько запятых, но на интересность сообщения это никак не повлияло :)

# 565gfhgh546

Tuesday, December 23, 2008 4:21 PM by NoipleCep

У меня одного какие-то проблемы с кодировкой в комментариях? Вместо ответов - одни знаки "?"

# 54656ghfghg56g

Wednesday, December 24, 2008 3:06 AM by Dignescasse

Круто. Добавлю блог в избранное и друзьям посовету. Ждите новых читателей :)

# 12345qwe

Wednesday, December 24, 2008 2:27 PM by Emargoarerled

Разместил это на своем блоге с ссылкой на ваш сайт. Надеюсь, Вам это какую-нибудь пользу принесет :)

# 12345qwe456

Wednesday, December 24, 2008 11:53 PM by kimemnsoymn

Занятно-занятно, нигде раньше на такое не натыкался.

# 90890fgh

Thursday, December 25, 2008 4:34 PM by Bralfeagreelp

Да, жаль, что обновления на блоге происходят не так часто, как хотелось бы.

# 90890fgh5465

Thursday, December 25, 2008 8:25 PM by deerlidge

Наткнулся случайно на Ваш блог. Теперь стану постоянно просматривать. Надеюсь, не разочаруете и дальше :)

# sxefvujmm

Thursday, December 25, 2008 11:00 PM by awacuuptmit

Пропущено несколько запятых, но на интересность сообщения это никак не повлияло :)

# re: SQL Server Error 26: Error Locating Server/Instance Specified

Sunday, December 28, 2008 3:29 AM by kbaukkp

Le4VaZ  <a href="rxedkppaavux.com/.../a>, [url=http://xlqhtcuijaqu.com/]xlqhtcuijaqu[/url], [link=http://msohtsdihloe.com/]msohtsdihloe[/link], http://qkwnomhrmfpi.com/

# сайт порнорэп

Sunday, January 04, 2009 1:01 PM by Turlulcex

голубое порно фильм скачать

бесплатное порно видео лишение девственности

хуй пизда домашнее порно видео

видео секс медсестра

<a href=pornevi.ru/page1828.html>%D0%B4%D0%BE%D1%81%D1%82%D1%83%D0%BF%D0%BD%D0%BE%D0%B5 порно видео</a>

видео порно скачать tcgkfnyj

приличные эротические фильмы

русское порно ученики ебут учительницу видео ролики

скачать порно видео быстро бесплатно и без регистрации

<a href=pornevi.ru/page737.html>%D1%8D%D1%80%D0%BE%D1%82%D0%B8%D0%BA%D0%B0 секс видеоролики</a>

секс сучки видео

скачать фильм чувство секса

изнасилование видео порно бесплатно

эротическое видео пожилых

<a href=pornevi.ru/page602.html>%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE дом2 порно рома ебет бузову</a>

секс порно фильм скачать

скачат бесплатно мульт-эротические фотки

эротические компьютерные пазлы скачать

mp4 порно скачать

порно видео екатеринбурга

секс девственниц видео

бесплатные большие порно фильмы

жесткий секс с дамами порно скачать бесплатно

скачать бесплатно порно видио фильмы

скачать эротический flash мультик 3way

бесплатно скачат 3gp порно

эротические флэш скачать

порносайт со зрелыми женщинами

форум эротические игры скачать

скачать 5 минутные секс ролики бесплатно и без регистрации

секс общага видео

скачать бесплатно xxx и эротическое видео

лучшее порно скачать

фильмы порнографического содержания

смотреть секс видео в живую

бесплатные 3gp видео эротика

минутные бесплатные порно ролики

бесплатное порно видео ролики маленькие

скачать книгу оральный секс

транссексуал сайт

бесплатно скачатькурпатов 3 роковых инстинкта жизнь власть секс

липецкий сайт порно

топ сайтов русской эротики

скачать порнофильм целиком бесплатно

скачать порно ролики с томских сайтов

сайт с сексом из фильмов

где скачать фильмы с порнуху

порнография на видео бесплатно

скачать порнуху фильм бесплатно

бесплатного супер порно сайт

видио ролики порно смотреть без платно

# Информативный проект

Thursday, January 08, 2009 4:16 PM by Миша

Весьма интересно, буду следить за развитием проекта. Удачи!

# re: SQL Server Error 26: Error Locating Server/Instance Specified

Saturday, January 10, 2009 7:24 PM by ngvzchp

qBX1Bg  <a href="qbluuuikztns.com/.../a>, [url=http://ccpigqekrbnd.com/]ccpigqekrbnd[/url], [link=http://njejlvhfuiww.com/]njejlvhfuiww[/link], http://vacgmechtexv.com/

# re: SQL Server Error 26: Error Locating Server/Instance Specified

Tuesday, January 13, 2009 3:22 AM by gpyaeug

RA1I3T  <a href="ksghwzjlhotx.com/.../a>, [url=http://qsqggsnvhhnz.com/]qsqggsnvhhnz[/url], [link=http://eyndqtypfxlb.com/]eyndqtypfxlb[/link], http://bbploeqcpnyt.com/

# re: SQL Server Error 26: Error Locating Server/Instance Specified

Monday, May 11, 2009 4:42 PM by Sachin

Thanks it helps

# re: SQL Server Error 26: Error Locating Server/Instance Specified

Sunday, May 31, 2009 2:33 AM by Peyman

Thank You very very much

i've spend about 24 hours to findout the problem caused by what.

finally i found it here.

good luck

and with best wishes

# re: SQL Server Error 26: Error Locating Server/Instance Specified

Tuesday, October 06, 2009 11:45 AM by elham

thanks a lot!

Leave a Comment

(required) 
(required) 
(optional)
(required) 
Please add 8 and 1 and type the answer here:
Powered by Community Server (Commercial Edition), by Telligent Systems