• 大小: 748KB
    文件类型: .zip
    金币: 2
    下载: 1 次
    发布日期: 2021-05-29
  • 语言: C#
  • 标签: ASP  +SQL  SERVER  

资源简介

可以用vs2010运行,c#,数据库是SQL Server

资源截图

代码片段和文件信息

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;

//源码下载 www.51aspx.com
public partial class _Default : System.Web.UI.Page
{

    

    protected void Page_Load(object sender EventArgs e)
    {
        this.title = “欢迎光临星星书城“;
        Panel1.Visible = true;
        Panel2.Visible = false;

        //显示新书上架
        //连接和打开数据库
        SqlConnection conn = new SqlConnection();
        conn.ConnectionString = “server=localhost;database=WebData;integrated security=true“;
        conn.Open();
        //执行SQL语句命令
        string sql = “select  图书名称 from 图书信息表“;
        SqlDataAdapter da = new SqlDataAdapter(sql conn);

        DataSet ds = new DataSet();
        da.Fill(ds “图书信息表“);

        Repeater1.DataSource = ds.Tables[“图书信息表“];
        Repeater1.DataBind();
        conn.Close();

    }
    protected void ImageButton1_Click(object sender ImageClickEventArgs e)
    {
        Panel2.Visible = true;
        Panel1.Visible = false;
        SqlConnection conn = new SqlConnection();
        conn.ConnectionString = “server=localhost;database=WebData;integrated security=true“;
        conn.Open();
        SqlDataAdapter da = new SqlDataAdapter(“select * from 图书信息表 where 图书名称 like ‘%“ + TextBox3.Text+ “%‘“ conn);
        DataSet ds = new DataSet();
        da.Fill(ds “图书信息表“);
        if (ds.Tables[“图书信息表“].Rows.Count!=0)
        {
            
            Label4.Text = “您查询的信息如下:“;
            DataList2.Visible = true;
            DataList2.DataSource = ds.Tables[“图书信息表“];
            DataList2.DataBind();
           
        }
        else
        {

            Label4.Text = “对不起,没有您查询的书“;
            DataList2.Visible = false;
        }
        
        
    }
   
    protected void ImageButton2_Click(object sender ImageClickEventArgs e)
    {
        SqlConnection conn = new SqlConnection();
        conn.ConnectionString = “server=localhost;database=WebData;integrated security=true“;
        conn.Open();
        SqlDataAdapter da = new SqlDataAdapter(“select * from 客户信息表 where 客户姓名=‘“ + Name.Text + “‘ and 密码=‘“ + PassWord1.Text + “‘“conn);
        DataSet ds = new DataSet();
        da.Fill(ds “客户信息表“);
       
        
        //dsread(“select * from 客户信息表 where 客户姓名=‘“ + Name.Text + “‘ and 密码=‘“ + PassWord1.Text + “‘“ “客户信息表“);
        
   
        if (ds.Tables[“客户信息表“].Rows.Count!=0)
        {
            Label3.Text = “欢迎“ + Name.Text + “光临“;
            Session[“denglu“] = “chenggong“;
            Session[“yhm“] = Name.Text;
        }
        else
        {
            Label3.Text = “未能找到您的信息,请登录!“;
        }
       

       
    }
    protected void ImageButton3_Click(object sender ImageClickEventArgs e

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2013-05-20 17:13  xingxingshucheng\
     文件        1781  2010-01-04 09:38  xingxingshucheng\51aspx源码必读.txt
     目录           0  2013-05-13 22:25  xingxingshucheng\DB_51aspx\
     文件     2490368  2013-05-15 20:27  xingxingshucheng\DB_51aspx\WebData_Data.MDF
     文件     3932160  2013-05-15 20:27  xingxingshucheng\DB_51aspx\WebData_Log.LDF
     文件        8294  2009-12-12 00:42  xingxingshucheng\Default.aspx
     文件        3367  2010-01-04 09:33  xingxingshucheng\Default.aspx.cs
     文件        1642  2013-05-13 22:25  xingxingshucheng\Web.Config
     目录           0  2013-05-13 22:25  xingxingshucheng\admin\
     文件        2445  2009-12-12 15:28  xingxingshucheng\admin\MasterPage.master
     文件         423  2009-12-09 16:52  xingxingshucheng\admin\MasterPage.master.cs
     文件        1844  2010-01-04 09:26  xingxingshucheng\admin\huiyuan-detal.aspx
     文件        2009  2010-01-04 09:33  xingxingshucheng\admin\huiyuan-detal.aspx.cs
     文件        3961  2009-12-12 15:29  xingxingshucheng\admin\huiyuan.aspx
     文件         518  2009-12-10 20:15  xingxingshucheng\admin\huiyuan.aspx.cs
     文件        2577  2009-12-12 16:20  xingxingshucheng\admin\index.aspx
     文件        1387  2010-01-04 09:33  xingxingshucheng\admin\index.aspx.cs
     文件        4963  2009-12-12 15:48  xingxingshucheng\admin\order-edit.aspx
     文件         540  2010-01-04 09:34  xingxingshucheng\admin\order-edit.aspx.cs
     文件        6366  2009-12-12 15:49  xingxingshucheng\admin\order.aspx
     文件        2632  2009-12-12 01:29  xingxingshucheng\admin\order.aspx.cs
     文件         929  2009-12-12 12:46  xingxingshucheng\admin\sell-tj.aspx
     文件        1414  2009-12-12 12:41  xingxingshucheng\admin\sell-tj.aspx.cs
     文件        2727  2009-12-11 16:30  xingxingshucheng\admin\tianjia.aspx
     文件        2353  2010-01-04 09:34  xingxingshucheng\admin\tianjia.aspx.cs
     文件        2115  2009-12-11 20:14  xingxingshucheng\admin\xiugai-detail.aspx
     文件        4502  2009-12-12 15:08  xingxingshucheng\admin\xiugai-detail.aspx.cs
     文件        4653  2009-12-12 15:27  xingxingshucheng\admin\xiugai.aspx
     文件         519  2009-12-10 20:43  xingxingshucheng\admin\xiugai.aspx.cs
     目录           0  2013-05-13 22:25  xingxingshucheng\css\
     文件       11779  2009-12-10 22:59  xingxingshucheng\css\style.css
............此处省略48个文件信息

评论

共有 条评论