Microsoft Knowledge Base Article
This article contents is Microsoft Copyrighted material.
©2005-©2007 Microsoft Corporation. All rights reserved.
Terms
of Use |
Trademarks
Article ID: 826829 - Last Review: November 2, 2007 - Revision: 2.2
You receive a "General network error" error message when you make a request to an SQL adapter
On This Page
SYMPTOMS
When you use an encrypted channel (for example, a connection
that uses the HTTPS protocol) to make a request to a Microsoft SQL adapter, the SQL
adapter may return the following error message:
General
network error. Check your network documentation.
CAUSE
When you use an encrypted channel to make a request to an
SQL adapter, if the SQL adapter connects to an instance of SQL Server that is
not configured to handle Secure Socket Layer (SSL) communication, you notice
the error that is mentioned in the "Symptoms" section of this
article.
RESOLUTION
To resolve this problem, when you use an encrypted channel
to make a request to an SQL adapter, make sure that the instance of SQL Server
is configured to handle SSL communication.
STATUS
This
behavior is by design.
MORE INFORMATION
Steps to reproduce the behavior
- Create a virtual directory, and then enable SSL
communication for the virtual directory.
For additional information, click the following article number to view the article in the Microsoft Knowledge Base:
298805Â
(http://kbalertz.com/Feedback.aspx?kbNumber=298805/
)
How to enable SSL for all customers who interact with your Web site in Internet Information Services
- Start Microsoft Visual Studio .NET or Microsoft Visual Studio 2005.
- On the File menu, point to
New, and then click Project.
Note In Microsoft Visual Studio 2005, on the File menu, point to
New, and then click Web Site. - Under Project Types, click Visual
C# Projects or click Visual Basic
Projects.
Note In Microsoft Visual Studio 2005, under Templates, click ASP.NET Web
Site. - Under Templates, click ASP.NET Web
Application.
Note In Microsoft Visual Studio 2005, select Visual C# or Visual Basic in the Language box. - In the Location box, type
https://ServerName/AspWebSecureTest,
and then click OK.
Note In Microsoft Visual Studio 2005, in the Location box, select HTTP, type
https://ServerName/AspWebSecureTest,
and then click OK.- ServerName is a placeholder
for the name of a Web server.
- AspWebSecureTest is the name of a sample ASP.NET Web
Application project.
- If you are using Microsoft Visual C# .NET, in the
WebForm1.aspx.cs file, add the following code
using System.Data.SqlClient
beforeIf you are using Microsoft Visual Basic .NET, in the WebForm1.aspx.vb
file, add the following code as the first statement of the file:Imports System.Data.SqlClient
- Add a Button control and a Label control to the
WebForm1.aspx form.
Note In Microsoft Visual Studio 2005, add a Button control and a Label control to the
Default.aspx form. - Set the ID property of the Label control
to Result.
- In the Click event handler of the Button control, add the following
code.
Note Replace ServerName with the name of an
instance of SQL Server, and replace UserID and
Password with appropriate values for a user who has
credentials to access the instance of SQL Server.
Visual C# .NET codetry
{
// Use appropriate values for ServerName, UserID, and Password.
SqlConnection sConn = new SqlConnection ("server=ServerName;database=Northwind;user id=UserID;password=Password;");
string query = "Select * from categories";
SqlDataAdapter oAdapter = new SqlDataAdapter (query, sConn);
DataSet ds = new DataSet();
oAdapter.Fill(ds, "category");
Result.Text += ": No Error";
}
catch (SqlException Ex)
{
Result.Text += ": Error "+Ex.Message;
} Visual Basic .NET code
Dim sConn As SqlConnection
Dim query As String
Dim oAdapter As SqlDataAdapter
Dim ds As DataSet
Try
' Use appropriate values for ServerName, UserID, and Password.
sConn = New SqlConnection("server=ServerName;database=Northwind;user id=UserID;password=Password;")
query = "Select * from categories"
oAdapter = New SqlDataAdapter(query, sConn)
ds = New DataSet
oAdapter.Fill(ds, "category")
Result.Text += ": No Error"
Catch exp As SqlException
Result.Text += ": Error " + exp.Message
End Try - On the Debug menu, click
Start.
- In the browser window that appears, click the button. You
may notice the error that is mentioned in the "Symptoms" section of this
article.
REFERENCES
For additional information, click the following article numbers to view the articles in the Microsoft Knowledge Base:
276553Â
(http://kbalertz.com/Feedback.aspx?kbNumber=276553/
)
How to enable SSL encryption for SQL Server 2000 with Certificate Server
298805Â
(http://kbalertz.com/Feedback.aspx?kbNumber=298805/
)
How to enable SSL for all customers who interact with your Web site in Internet Information Services
APPLIES TO
- Microsoft ADO.NET 2.0
- Microsoft ADO.NET 1.1
- Microsoft SQL Server 2000 Developer Edition
- Microsoft SQL Server 2000 Enterprise Edition
- Microsoft SQL Server 2000 Personal Edition
- Microsoft SQL Server 2000 Standard Edition
| kbtshoot kberrmsg kbsetup kbsqlclient kbprb KB826829 |
Community Feedback System
Very often, it takes hours to solve a problem. Very often, you've looked high
and low, and have tried a lot of solutions. When you finally found it, chances
are, it was because someone else helped you. Here's your chance to give back.
Use our community feedback tool to let others know what worked for you and what
didn't.
Please also understand that the community feedback system is not warranted to be
correct, it's simply a system that we've built to let people try and help each
other. If something in a feedback response doesn't make sense to you, or you're
not comfortable making changes that the feedback talks about (like registry
edits), please consult a professional.
Thank you for using kbAlertz.com Feedback System.
-- Scott Cate
Be the first to leave feedback, to help others about this knowledge base
article.
(Optional) Name
(Optional)
Public URL Or Email
Comments
No
HTML -- Text Only Please