我是在按照一本.NET的书上的实例写的代码,用于实现和SQL的相连,请问为什么我调试时,
会出现“当前上下文中不存在mySqlConnection”和“不存在mySqlConnection”的错误呢??代码:
using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
public partial class _Default : System.Web.UI.Page 
{
    protected void Page_Load(object sender, EventArgs e)
    {
        string connectionString = "server=localhost; database=Northwind";
        System.Data.SqlClient.SqlConnection.mySqlConnection = new System.Data.SqlClient.SqlConnection(connectionString);
        
        try
        {
            mySqlConnection.Open();
            
            System.Web.HttpContext.Current.Response.Write("打开数据库成功!");
         }             
         catch (System.Data.SqlClient.SqlException ex)
        {
             System.Web.HttpContext.Current.Response.Write(ex.Message.ToString());
         }
        finally 
        {
            mySqlConnection.Close();
            System.Web.HttpContext.Current.Response.Write("Close the SQL connection successfully!~");
        }
}
}