單擊
http://develop
圖
DataGrid控件用來向管理員展示已有的連鎖店銷售信息
private void Page_Load(object sender
{
if(Session[
{
//獲得數據庫連接字符串
string STconnection = ConfigurationSettings
STconn = new SqlConnection(STconnection);
if(!IsPostBack)
{
//自定義BindGrid ()方法
BindGrid();
}
}
else
{
Response
}
}
//加載連鎖店銷售的信息
public void BindGrid()
{
//創建查詢連鎖店銷售信息的sql語句
string STstrsql=
//創建SqlDataAdapter的實例
SqlDataAdapter STsda=new SqlDataAdapter(STstrsql
//創建DataSet的實例
DataSet STds=new DataSet();
//將信息填充到DataSet
right
From:http://tw.wingwit.com/Article/program/net/201311/15500.html