求一个asp.net(C#)的简单学生信息管理系统,只需要有添加,删除,查询功能 10
3个回答
展开全部
public void SetBind()
{
DataTable dt = new DataTable();
dt = GetLgList();
GridView1.DataSource = dt;
GridView1.DataBind();
}
public DataTable GetLgList()
{
string strconn=System.Configuration.ConfigurationSettings.AppSettings["xs"];
SqlConnection sqlconn = new SqlConnection(strconn);
string sqlstr = "select * from user_table where 1=1";
sqlstr += "and user_name like '%"+usernameTXT.Text+"%'";
SqlDataAdapter sqlda=new SqlDataAdapter(sqlstr,sqlconn);
DataTable dt =new DataTable();
sqlda.Fill(dt);
return dt;
}
private void delete()
{
string strconn=System.Configuration.ConfigurationSettings.AppSettings["xs"];
SqlConnection sqlconn = new SqlConnection(strconn);
sqlconn.Open();
string strcmd = "delete from user_table where user_name='"+username+"'";
SqlCommand sqlcmd = new SqlCommand(strcmd,sqlconn);
sqlcmd.ExecuteNonQuery();
sqlconn.Close();
SetBind();
}
{
DataTable dt = new DataTable();
dt = GetLgList();
GridView1.DataSource = dt;
GridView1.DataBind();
}
public DataTable GetLgList()
{
string strconn=System.Configuration.ConfigurationSettings.AppSettings["xs"];
SqlConnection sqlconn = new SqlConnection(strconn);
string sqlstr = "select * from user_table where 1=1";
sqlstr += "and user_name like '%"+usernameTXT.Text+"%'";
SqlDataAdapter sqlda=new SqlDataAdapter(sqlstr,sqlconn);
DataTable dt =new DataTable();
sqlda.Fill(dt);
return dt;
}
private void delete()
{
string strconn=System.Configuration.ConfigurationSettings.AppSettings["xs"];
SqlConnection sqlconn = new SqlConnection(strconn);
sqlconn.Open();
string strcmd = "delete from user_table where user_name='"+username+"'";
SqlCommand sqlcmd = new SqlCommand(strcmd,sqlconn);
sqlcmd.ExecuteNonQuery();
sqlconn.Close();
SetBind();
}
展开全部
可以凭借Baiduhi提醒我
有时间能够处理你所遇到的工作
相近的要求也能够提醒我
求一个asp.net(C#)的简单学生信息管理**,只需要有添加...
ES:\\BDE6B4CCD4AA2B9600858A2477165130
有时间能够处理你所遇到的工作
相近的要求也能够提醒我
求一个asp.net(C#)的简单学生信息管理**,只需要有添加...
ES:\\BDE6B4CCD4AA2B9600858A2477165130
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
你加个dateview就可以 系统自带增删该茶
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询