private void DataList1_DeleteCommand_1(object source, System.Web.UI.WebControls.DataListCommandEventArgs e)
{
int tmpCount = this.DataList1.Items.Count;
for (int i = 0 ; i< tmpCount; i++)
{
string tmpID = this.DataList1.DataKeys[i].ToString();
CheckBox delCheckbox =(CheckBox)this.DataList1.Items[i].FindControl("ok");
if (delCheckbox.Checked)
{
conn=new SqlConnection(ConfigurationSettings.AppSettings["sqlConn"]);
conn.Open();
string strSql = "delete from SD_User where id = " + tmpID;
comm= new SqlCommand(strSql,conn);
comm.ExecuteNonQuery();
}
}
//getPic();
this.DataBind();
conn.Close();
}//帮我看看这个那个地方错了啊
{
int tmpCount = this.DataList1.Items.Count;
for (int i = 0 ; i< tmpCount; i++)
{
string tmpID = this.DataList1.DataKeys[i].ToString();
CheckBox delCheckbox =(CheckBox)this.DataList1.Items[i].FindControl("ok");
if (delCheckbox.Checked)
{
conn=new SqlConnection(ConfigurationSettings.AppSettings["sqlConn"]);
conn.Open();
string strSql = "delete from SD_User where id = " + tmpID;
comm= new SqlCommand(strSql,conn);
comm.ExecuteNonQuery();
}
}
//getPic();
this.DataBind();
conn.Close();
}//帮我看看这个那个地方错了啊