using System;
using System.Data;
using System.Data.SqlClient;
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
{
string strconn = "data source=localhost://SQLEXPRESS;initial catalog=Northwind;user id=sa;password=sa123";
SqlConnection myconn = new SqlConnection(strconn);
protected void Page_Load(object sender, EventArgs e)
{
string strSQL = "select top 5 CategoryID,CategoryName,Description from Categories";
SqlCommand mycomm = new SqlCommand(strSQL, myconn);
myconn.open();
mygv.DataSource = myCommand.ExecuteReader();
mygv.DataBind();
myconn.close();
}
}
又显示不包含open 和
close的定义
各位大虾帮帮忙