Microsoft KB Archive/826829

= You receive a &quot;General network error&quot; error message when you make a request to an SQL adapter =

Article ID: 826829

Article Last Modified on 11/2/2007

-

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

-



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 &quot;Symptoms&quot; 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.



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 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:// /AspWebSecureTest, and then click OK.

Note In Microsoft Visual Studio 2005, in the Location box, select HTTP, type https:// /AspWebSecureTest, and then click OK. <ul>  is a placeholder for the name of a Web server.</li> AspWebSecureTest is the name of a sample ASP.NET Web Application project.</li></ul> </li>  If you are using Microsoft Visual C# .NET, in the WebForm1.aspx.cs file, add the following code using System.Data.SqlClient before using System; If 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 </li> 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.</li> Set the ID property of the Label control to Result .</li>  In the Click event handler of the Button control, add the following code.

Note Replace  with the name of an instance of SQL Server, and replace   and   with appropriate values for a user who has credentials to access the instance of SQL Server.

Visual C# .NET code try {   // Use appropriate values for ServerName, UserID, and Password. SqlConnection sConn = new SqlConnection (&quot;server=ServerName;database=Northwind;user id=UserID;password=Password;&quot;); string query = &quot;Select * from categories&quot;; SqlDataAdapter oAdapter = new SqlDataAdapter (query, sConn); DataSet ds = new DataSet; oAdapter.Fill(ds, &quot;category&quot;); Result.Text += &quot;: No Error&quot;; } catch (SqlException Ex) {   Result.Text += &quot;: Error &quot;+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(&quot;server=ServerName;database=Northwind;user id=UserID;password=Password;&quot;) query = &quot;Select * from categories&quot; oAdapter = New SqlDataAdapter(query, sConn) ds = New DataSet oAdapter.Fill(ds, &quot;category&quot;) Result.Text += &quot;: No Error&quot; Catch exp As SqlException Result.Text += &quot;: Error &quot; + exp.Message End Try </li> On the Debug menu, click Start.</li> In the browser window that appears, click the button. You may notice the error that is mentioned in the &quot;Symptoms&quot; section of this article.</li></ol>

<div class="references_section">