温馨提示:代码在线浏览功能只能做为源码浏览参考,如果想更进一步了解该代码请下载:某酒店用品市场全站源码
当前文件:
HotelSuppliesMarket/userinfo/modifyuser.aspx.cs[1K,2009-6-12 11:44:29],打开代码结构图
HotelSuppliesMarket/userinfo/modifyuser.aspx.cs[1K,2009-6-12 11:44:29],打开代码结构图1using System; 2
using System.Data; 3
using System.Data.SqlClient; 4
using System.Configuration; 5
using System.Collections; 6
using System.Web; 7
using System.Web.Security; 8
using System.Web.UI; 9
using System.Web.UI.WebControls; 10
using System.Web.UI.WebControls.WebParts; 11
using System.Web.UI.HtmlControls; 12
13
public partial class userinfo_modifyuser : System.Web.UI.Page 14
{ 15
protected void Page_Load(object sender, EventArgs e) 16
{ 17
if (!IsPostBack) 18
{ 19
repeaterdatabind(); 20
} 21
} 22
public void repeaterdatabind() 23
{ 24
SqlConnection conn = db.createconn(); 25
SqlDataAdapter myAdapter = new SqlDataAdapter("select * from admin",conn); 26
DataSet ds = new DataSet(); 27
myAdapter.Fill(ds,"admin"); 28
this.usermodi.DataSource = ds; 29
this.usermodi.DataMember = "admin"; 30
this.usermodi.DataBind(); 31
} 32
protected void DelComm_Click(object sender, CommandEventArgs e) 33
{ 34
int ID = Convert.ToInt32(e.CommandName); 35
36
SqlConnection Conn = db.createconn(); 37
Conn.Open(); 38
39
SqlCommand Cmd = new SqlCommand("delete from admin where userid=" + ID, Conn); 40
41
42
Cmd.ExecuteNonQuery(); 43
44
Conn.Close(); 45
Response.Redirect("./modifyuser.aspx"); 46
} 47
} 48






}
}