public class ben:harrell

July 26, 2006

odd sql 2005 connection error

Filed under: .NET, Technology — benjamin harrell @ 2:46 pm

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 connections. (provider: SQL Network Interfaces, error: 26 – Error Locating Server/Instance Specified)

 If all else looks correctly configured then this might be a control using personalization that uses SQLExpress by default.  An example of such a control is the WebPartsManager, this control is a wonderful control in ASP.NET 2.0 and allows for the web part behavior on a page but if you enable the personalization in the properties screen (default is enabled) then this control will attempt to use SQLExpress to store its personalization info.  This might be fine for some sites but not everyone wants to run SQLExpress in production so I disabled personalization for now until I can figure out how to point personalization to a SQL Instance on another server.  I’ll post that as soon as I figure it out, in the meantime if anyone has the answer please fill me in.

Advertisements

3 Comments »

  1. Um… You have your answer to this question posted in the question above it. To personalize webparts using an external database you need to replace the default provider. i.e.

    Perhaps you’re having trouble setting up the personal provider database in SQL? If that’s the case then do a search for ASPNET_REGSQL.EXE in the MSDN documentation. Using this nifty little utility you can easily create the database schema required to personalize web parts. This utility along with your connection string solution will give you the ability to use an external SQL server.

    Good Luck,
    Johnny

    Comment by John Lieurance — October 13, 2006 @ 5:45 pm

  2. Just another quick comment. The XML code I cut in pasted didn’t make it through the submission process. I would image there’s a scripting filter here to prevent hacking. My appologies for not knowing how to format it correct. In the mean time here the code that belongs after the “i.e.” in my previous post. Please note that I’ve replaced the “” with “[” and “]”.

    [webParts][personalization][providers]

    [remove name=“AspNetSqlPersonalizationProvider“ /]

    [add connectionStringName=“my_connection_string” name=“AspNetSqlPersonalizationProvider“
    type=“System.Web.UI.WebControls.WebParts.SqlPersonalizationProvider” applicationName=“/“/]

    [/providers][/personalization][/webParts]

    Comment by John Lieurance — October 13, 2006 @ 5:49 pm

  3. Thanks for the help Johnny, the post above (posted 30 minutes later) was actually as I figured out the solution a little bit later but your information was also helpful. Thank you!

    Comment by benjamin harrell — October 13, 2006 @ 6:02 pm


RSS feed for comments on this post. TrackBack URI

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Blog at WordPress.com.

%d bloggers like this: