• 大小: 12.75MB
    文件类型: .rar
    金币: 1
    下载: 0 次
    发布日期: 2023-07-30
  • 语言: C#
  • 标签: asp.net  

资源简介

asp.net 期末大作业 基本包含一学期所学内容

资源截图

代码片段和文件信息

using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Data.SqlClient;

public partial class deletet : System.Web.UI.Page
{
    protected void Page_Load(object sender EventArgs e)
    {
        if (!Page.IsPostBack) bindgrid();
    }
   void bindgrid()
    {
        string sqlconnstr = ConfigurationManager.ConnectionStrings[“ConnectionString“].ConnectionString; ;
        DataSet ds = new DataSet();

        using (SqlConnection sqlconn = new SqlConnection(sqlconnstr))
        {
            SqlDataAdapter sqld = new SqlDataAdapter(“select 名称信息图片 from 资料“ sqlconn);
            sqld.Fill(ds “tabstudent“);
        }

        //判断是否已经进行排序,如果是则按照ViewState中存储的信息生成排序后的DataView对象
        if (ViewState[“SortDirection“] == null)
            GridView1.DataSource = ds.Tables[“tabstudent“].DefaultView;
        else
        {
            DataView SortedDV = new DataView(ds.Tables[“tabstudent“]);
            SortedDV.Sort = ViewState[“Sortexpression“].ToString() + “ “ + ViewState[“SortDirection“].ToString();
            GridView1.DataSource = SortedDV;

        }
        GridView1.DataBind();

    }

    protected void Button1_Click(object sender EventArgs e)
    {
        //当前行
        int rowindex = ((GridViewRow)(((Button)sender).NamingContainer)).RowIndex;

        //设置数据库连接
        string connstr = ConfigurationManager.ConnectionStrings[“ConnectionString“].ConnectionString; ;
        SqlConnection conn = new SqlConnection(connstr);


        //删除行处理
        String sql = “delete from 资料 where 名称=‘“ + GridView1.DataKeys[rowindex].Value.ToString() + “‘“;

        SqlCommand Comm = new SqlCommand(sql conn);

        conn.Open();
        Comm.ExecuteNonQuery();
        conn.Close();
        conn = null;
        Comm = null;

        bindgrid();

    }

}

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件       3186  2012-05-14 20:46  ne\App_Code\baseClass.cs

     文件    2490368  2012-06-10 14:44  ne\App_Data\实例数据库.MDF

     文件     516096  2012-06-10 14:44  ne\App_Data\实例数据库_log.ldf

     文件      45056  2012-05-14 20:46  ne\Bin\FredCK.FCKeditorV2.dll

     文件       1105  2012-06-02 10:20  ne\deletet.aspx

     文件       2184  2012-06-02 13:33  ne\deletet.aspx.cs

     文件        236  2012-05-14 20:46  ne\fckeditor\editor\css\behaviors\disablehandles.htc

     文件        822  2012-05-14 20:46  ne\fckeditor\editor\css\behaviors\showtableborders.htc

     文件       2648  2012-05-14 20:46  ne\fckeditor\editor\css\fck_editorarea.css

     文件       4145  2012-05-14 20:46  ne\fckeditor\editor\css\fck_internal.css

     文件       1696  2012-05-14 20:46  ne\fckeditor\editor\css\fck_showtableborders_gecko.css

     文件        288  2012-05-14 20:46  ne\fckeditor\editor\css\images\block_address.png

     文件        293  2012-05-14 20:46  ne\fckeditor\editor\css\images\block_blockquote.png

     文件        229  2012-05-14 20:46  ne\fckeditor\editor\css\images\block_div.png

     文件        218  2012-05-14 20:46  ne\fckeditor\editor\css\images\block_h1.png

     文件        220  2012-05-14 20:46  ne\fckeditor\editor\css\images\block_h2.png

     文件        219  2012-05-14 20:46  ne\fckeditor\editor\css\images\block_h3.png

     文件        229  2012-05-14 20:46  ne\fckeditor\editor\css\images\block_h4.png

     文件        236  2012-05-14 20:46  ne\fckeditor\editor\css\images\block_h5.png

     文件        216  2012-05-14 20:46  ne\fckeditor\editor\css\images\block_h6.png

     文件        205  2012-05-14 20:46  ne\fckeditor\editor\css\images\block_p.png

     文件        223  2012-05-14 20:46  ne\fckeditor\editor\css\images\block_pre.png

     文件        184  2012-05-14 20:46  ne\fckeditor\editor\css\images\fck_anchor.gif

     文件        599  2012-05-14 20:46  ne\fckeditor\editor\css\images\fck_flashlogo.gif

     文件        105  2012-05-14 20:46  ne\fckeditor\editor\css\images\fck_hiddenfield.gif

     文件         54  2012-05-14 20:46  ne\fckeditor\editor\css\images\fck_pagebreak.gif

     文件       1709  2012-05-14 20:46  ne\fckeditor\editor\css\images\fck_plugin.gif

     文件       1773  2012-05-14 20:46  ne\fckeditor\editor\dialog\common\fck_dialog_common.css

     文件      10481  2012-05-14 20:46  ne\fckeditor\editor\dialog\common\fck_dialog_common.js

     文件         74  2012-05-14 20:46  ne\fckeditor\editor\dialog\common\images\locked.gif

............此处省略503个文件信息

评论

共有 条评论