Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C# ASP.NET
Dear All;
 
The problem is as follows:-
 
I have VS 2010 & SQL Express 2008 which installed alongwith VS 2010.
 
The problem is I installed a named instance called SQLEXP & deleted default SQLEXPRESS instance .I changed it in Options -> in VS2010 to use new instance works fine I can connect to database
 

But still the problems appear in a ASP.net site [created before instance change] when run user cant login as server cant be connected
 
Error-26 Cannot connect to instance specified;
 
Why cant the database be connected when I changed it[instance name] in VS settings menu.
 
Also I could earlier use Website Admin Tool to create users which store in ASPNET.MDF but now it also cant connect in Web admin tool.Any solutions pls?
Posted 9-May-13 23:02pm

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

Update your DataSource in connection string. Go to web.config --> Find your connection string --> Update data source from .\SQLEXPRESS to YourMachineName\SQLEXPRESS.
Try this:
connectionString="data source=YourMachineName\SQLEXPRESS;
   Integrated Security=SSPI;
   Initial Catalog=aspnetdb;" 
 

--Amit
  Permalink  
Comments
Mantu Singh at 13-May-13 9:18am
   
Web config file does not have connection string it worked automatically

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 OriginalGriff 6,055
1 DamithSL 4,621
2 Maciej Los 4,087
3 Kornfeld Eliyahu Peter 3,500
4 Sergey Alexandrovich Kryukov 3,294


Advertise | Privacy | Mobile
Web02 | 2.8.141220.1 | Last Updated 10 May 2013
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100