asp.net 删除数据 学习资料_数据库学习资料
asp.net 删除数据 学习资料由刀豆文库小编整理,希望给你工作、学习、生活带来方便,猜你可能喜欢“数据库学习资料”。
删除数据
protected void Button2_Click(object sender, EventArgs e)
{
SqlConnection conn = new
SqlConnection(ConfigurationManager.ConnectionStrings[“newsConnectionString”].ConnectionString);SqlCommand cmd = new SqlCommand();
cmd.CommandText=“delete from login where 编号='”+this.TextBox1.Text+“'”;cmd.Connection=conn;
conn.Open();
cmd.ExecuteNonQuery();
conn.Close();
Response.Write(“”);Response.Redirect(“Default.aspx”);
}
更新数据protected void Button1_Click(object sender, EventArgs e){SqlConnection con = newSqlConnection(ConfigurationManager.ConnectionStrings["newsConnectionStr......
前台代码<%@ Page Language="C#" AutoEventWireup="true" CodeFile="login.aspx.cs" Inherits="login" %> "http://www.daodoc.com/TR/xhtml1/DTD/xhtml1-transiti......
前台代码<%@ Page Language="C#" AutoEventWireup="true"CodeFile="Default.aspx.cs" Inherits="_Default" %> "http://www.daodoc.com/TR/xhtml1/DTD/xhtml1-tran......
检查用户名是否存在功能模块protected void Button1_Click(object sender, EventArgs e){usernamevalidate();}private int usernamevalidate(){SqlConnection conn = newSq......
后台代码protected void Button1_Click(object sender, EventArgs e){SqlConnection conn = newSqlConnection(ConfigurationManager.ConnectionStrings["connection"].Co......
