PDA

View Full Version : SQL Server 26 Error


OlgaE
11-19-2010, 01:40 AM
Last time I began to receive this error VERY frequently. Not every time but frequently. I didn't any changes to my connection string. Every connection is called from "using" clause so this is not the problem with many not closed connections.
What happen?
Please help.

At my development environment I use SQL Express, but at the discountasp server my connection string points to 2005 SQL Server.
connectionString="Data Source=tcp:sql2k514.discountasp.net;Initial Catalog=SQL2005_516252_cross;User ID=SQL2005_54345_adas_user;Password=12345"

The error is:
A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified)

jiveabillion
11-19-2010, 09:06 AM
I am also receiving this error. My database is on sql2k802.discountasp.net. I can connect to it with Management Studio and the web base management tool. I cannot, however, connect to it from Visual Studio or my website hosted on discountasp.net

Edit: Moments after posting this, my connection came back. It had been down all morning though.

bruce
11-19-2010, 10:24 AM
very strange..

So the same code works some times but not other?

OlgaE
11-19-2010, 10:38 AM
Exactly.
Bellow some links from my site:
http://www.cross-stitch-pattern.net/Kingfishers-9-29-Free-Design.aspx
http://www.cross-stitch-pattern.net/Castle-4-18-Free-Design.aspx
http://www.cross-stitch-pattern.net/Victorian-Woman-58-11-Free-Design.aspx
http://www.cross-stitch-pattern.net/Saffron-Milk-Cap-68-6-Free-Design.aspx
http://www.cross-stitch-pattern.net/Bride-in-a-Chariot-51-10-Free-Design.aspx
If you enter them in random order you will see the error. To eliminate it you should enter the home page http://www.cross-stitch-pattern.net/.
But after some time the error returns. Sometimes you will successfully reach all of them, sometimes you will fail with the first one.
:(

wisemx
11-19-2010, 11:28 AM
...Are you sure the code hits are the same?
It appears to be only throwing an exception from PhotoManager.cs on some of the page hits.
Is it possible there is an illegible character in the query for those pages failing?

OlgaE
11-19-2010, 11:44 AM
The Same page may cause an error and may not. Perhaps it traffic dependent?
I am sure that it is not the problem with illegal characters. Is fails on connection.open()

wisemx
11-19-2010, 12:10 PM
How many images are in the folder it's pulling from?

OlgaE
11-19-2010, 12:18 PM
It pulls from database. Therefore connection is opened. The page is generated from database.

wisemx
11-19-2010, 12:31 PM
Ooooo. That may indeed have something to do with the connection.
It is always better to have the images in folders and then link to them.
I do understand the reasons for dropping them as BLOB's in the DB but it is problematic.

OlgaE
11-19-2010, 12:35 PM
So your proposition is to retrieve the images from the database and store them in the directory?
There are almost 1000 images, but it is possible to write a simple c# program which runs through the database and stores the images at the disk.
Thank you. I feel that this will help.

wisemx
11-19-2010, 12:41 PM
My suggestion would be yes.
I'd look at the way some of the popular forum packages do this.
For example it is a good idea to limit image folders to 200 images or less.
Image folders should have a naming convention, i.e. ia, ib, ic, etc.
The only drawback is preventing people form hot-linking to the images.
If that isn't a problem then moving the images to disk and coming up with a naming/coding convention will pay off tremendously.

OlgaE
11-19-2010, 12:50 PM
Thank you a lot for the solution. I feel that you are right. I'll do it.
The only thing that I can't understand - how it worked till now? Some threshold was reached?

wisemx
11-19-2010, 12:51 PM
Yes I'd say the BLOB's are choking it and I have seen that happen.
It can be a real pain just pulling that many BLOBs up in SQL Server locally.

OlgaE
11-30-2010, 04:34 AM
:confused:
I saved all the pictiore on the disk. Database size reduced from 300 to 42
The connection became easie. But...
I still receive emails that people get that error. Somewhat about 1-2 emails each day. I suppose that the number of failures is much more - peope very rare inform webmasters about such failures - they simply go away.
How many parallel connections your SQL Server allows?

mjp
11-30-2010, 10:01 AM
The only information I could find on intermittent 26 error had to do with the site visitor running Vista and Windows Firewall on their computer (who knows, I've heard stranger things).

If you don't see the error anymore but some users do, you should ask them about O/S, browser, etc., and see if you can find some kind of common thread on their end.