??????1????web.config????????У?

<connectionStrings>
<add name="NorthwindConnectionString" connectionString="Data Source=localhost;Initial Catalog=Northwind;Persist Security Info=True;User ID=sa;Password=sa"
providerName="System.Data.SqlClient" />
</connectionStrings>
??????2???????У???????????????????using System.Web.Configuration;
??????3?????д?????????
protected void Page_Load(object sender?? EventArgs e)
{
//??web.config???????????????
string strConn = WebConfigurationManager.ConnectionStrings["NorthwindConnectionString"].ConnectionString;
SqlConnection myConn = new SqlConnection(strConn);
string strSQL = "SELECT Top 5 CategoryID??CategoryName??Description From Categories";
SqlCommand myCommand = new SqlCommand(strSQL?? myConn);
myConn.Open();
myGv.DataSource = myCommand.ExecuteReader();
myGv.DataBind();
myConn.Close();
}