</TR>
</TABLE>
</FONT>
</TD>
</TR>
</TABLE>
<uc
STUserDep
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()
{
STconn
//創建查詢連鎖店信息的sql語句
string STstrsql=
//創建數據庫的SqlCommand對象
SqlCommand STcmd = new SqlCommand(STstrsql
//創建SqlCommand對象的ExecuteReader()方法
SqlDataReader STsdr = STcmd
while(STsdr
{
//將連鎖店ID保存到會話中
Session[
//STDepID文本框得到連鎖店ID
STDepID
Session[
STDepName
Session[
STDepMaster
Session[
STDepInfo
}
}
right
From:http://tw.wingwit.com/Article/program/net/201311/15250.html