string aa="SELECT MAX(CONVERT(int, SUBSTRING(tab_mc, 5, 3))) FROM t_xt_table";
cc=sql.ExecuteScalar(aa).ToString().Trim();
if(cc=="")
{
temp1="user" +1;
}
else
{
bb=Convert.ToInt32(cc) + 1;
temp1="user" + bb;
}
2、需要确认的删除事件
private void dgrd_tab_ItemDataBound(object sender, System.Web.UI.WebControls.DataGridItemEventArgs e)
{
if(e.Item.ItemIndex != -1)
{
System.Web.UI.WebControls.Button b_del=(Button)e.Item.FindControl("Button4");
b_del.Attributes.Add("onclick","javascript:if(!window.confirm('确实要删除该列信息吗?是点‘确定’,否则点‘取消’'))return false;");
}
}