</asp:DataGrid></FONT></TD>
</TR>
</TABLE>
<uc
STUserInfo
private void Page_Load(object sender
{
if(Session[
{
//獲得數據庫連接字符串
string STconnection = ConfigurationSettings
//創建數據庫連接
STconn = new SqlConnection(STconnection);
if(!IsPostBack)
{
//自定義ST_DgBind()方法
BindGrid();
}
}
else
{
Response
}
}
//加載用戶的信息
public void BindGrid()
{
//獲取登錄用戶的登錄名
string STNickName = Session[
//根據登錄用戶名和管理權限創建查詢用戶所有信息的sql語句
string STstrsql=
//創建SqlDataAdapter的實例
SqlDataAdapter STsda=new SqlDataAdapter(STstrsql
//創建DataSet的實例
DataSet STds=new DataSet();
//將信息填充到DataSet
STsda
//將信息綁定到DataGrid
STmyGrid
STmyGrid
}
right
From:http://tw.wingwit.com/Article/program/net/201311/15365.html