• 大小: 3.68M
    文件类型: .zip
    金币: 1
    下载: 0 次
    发布日期: 2024-05-23
  • 语言: ASP
  • 标签: 选课  系统  

资源简介

1、本系统在
Windows 2003 Server/Windows xp professinal sp2
VS.NET2005
SQLServer2005
环境下调试通过

2、文件夹MyElectCourse\DB\下为系统所需要的数据库脚本文件

资源截图

代码片段和文件信息

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 adminCourse : System.Web.UI.Page
{
    protected void Page_Load(object sender EventArgs e)
    {
        if (!this.IsPostBack)
        {
            ddlBind();
            CourceDetailsShow();
        }
    }

    private void ddlBind()
    {
        string connStr = ConfigurationManager.ConnectionStrings[“ConnectionString“].ConnectionString;   //取出连接字符串
        string SqlStr = “SELECT teaIDteaName from Teacher“;
        DataSet ds = new DataSet();

        SqlConnection conn = new SqlConnection(connStr);    //创建连接对象
        if (conn.State.ToString() == “Closed“)              //如果连接关闭打开
            conn.Open();
        SqlDataAdapter da = new SqlDataAdapter(SqlStr conn);
        da.Fill(ds);                                        //从数据库中取数据放到DataSet数据集中
        if (conn.State.ToString() == “Open“)
            conn.Close();

        ddlTeacherName.DataSource = ds.Tables[0].DefaultView;
        ddlTeacherName.DataTextField = “teaName“;             //下拉列表框每项显示教师姓名
        ddlTeacherName.DataValueField = “teaID“;              //下拉列表框每项的值为教师编号
        ddlTeacherName.DataBind();        
    }
    private void CourceDetailsShow()
    {
        string connStr = ConfigurationManager.ConnectionStrings[“ConnectionString“].ConnectionString;   //取出连接字符串
        string SqlStr = “SELECT Cource.*Teacher.teaName from CourceTeacher where Cource.teaID=Teacher.teaID and Cource.courceID=‘“ + Request[“courceID“].ToString() + “‘ and Cource.teaID=‘“ + Request[“teaID“].ToString() + “‘“;
        SqlConnection conn = new SqlConnection(connStr);    //创建连接对象
        try
        {
            if (conn.State.ToString() == “Closed“)          //连接如果关闭,打开
                conn.Open();
            SqlCommand cmd = new SqlCommand(SqlStr conn);
            SqlDataReader sdr = cmd.ExecuteReader();
            if (sdr.Read())
            {
                courceName.Text = sdr[“courceName“].ToString();
                txtName.Text = sdr[“courceName“].ToString();
                ddlTeacherName.SelectedItem.Text = sdr[“teaName“].ToString();
                txtTime.Text = sdr[“courceTime“].ToString();
                txtAddress.Text = sdr[“courceAddress“].ToString();
                txtDetails.Text = sdr[“courceInfo“].ToString();
            }
            else
            {
                Response.Write(“数据库错误,没查询到该门课程!“);
                Response.End();
            }
        }
        catch (Exception ex)                                //异常处理
        {
            Response.Write(“数据库错误,错误原因:“ + ex.Message);
            Response.End();
        }
        finally
        {
            if (conn.State.To

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2008-01-22 20:40  网上选课\
     目录           0  2009-03-11 15:24  网上选课\MyElectCourse\
     目录           0  2009-03-11 15:24  网上选课\MyElectCourse\App_Data\
     文件    10485760  2007-03-05 17:25  网上选课\MyElectCourse\App_Data\ASPNETDB.MDF
     文件      516096  2007-03-05 17:25  网上选课\MyElectCourse\App_Data\aspnetdb_log.ldf
     目录           0  2009-03-11 15:24  网上选课\MyElectCourse\Controls\
     文件        2224  2007-03-05 17:25  网上选课\MyElectCourse\Controls\left.ascx
     文件         534  2007-03-05 17:25  网上选课\MyElectCourse\Controls\left.ascx.cs
     目录           0  2009-03-11 15:24  网上选课\MyElectCourse\DB\
     文件     1722880  2007-03-05 17:25  网上选课\MyElectCourse\DB\ElectClass.bak
     文件        9502  2007-03-05 17:25  网上选课\MyElectCourse\DB\ElectClass.sql
     文件        7436  2007-03-05 17:25  网上选课\MyElectCourse\DB\ElectClass.sql.bak
     目录           0  2009-03-11 15:24  网上选课\MyElectCourse\Images\
     文件        1265  2007-03-05 17:25  网上选课\MyElectCourse\Images\ADD.GIF
     文件         505  2007-03-05 17:25  网上选课\MyElectCourse\Images\CONFIRM.GIF
     文件        1056  2007-03-05 17:25  网上选课\MyElectCourse\Images\Close.GIF
     文件        1584  2007-03-05 17:25  网上选课\MyElectCourse\Images\FangKuai.gif
     文件        1073  2007-03-05 17:25  网上选课\MyElectCourse\Images\Login.GIF
     文件        1242  2007-03-05 17:25  网上选课\MyElectCourse\Images\QUERY.GIF
     文件        1221  2007-03-05 17:25  网上选课\MyElectCourse\Images\RESET.GIF
     文件         505  2007-03-05 17:25  网上选课\MyElectCourse\Images\RETURN.GIF
     文件        1209  2007-03-05 17:25  网上选课\MyElectCourse\Images\SubmitScore.GIF
     文件         322  2007-03-05 17:25  网上选课\MyElectCourse\Images\mm.gif
     文件         922  2007-03-05 17:25  网上选课\MyElectCourse\Images\movetool1.gif
     文件         171  2007-03-05 17:25  网上选课\MyElectCourse\Images\movetoolright1.gif
     文件         988  2007-03-05 17:25  网上选课\MyElectCourse\Images\name.gif
     文件        1401  2007-03-05 17:25  网上选课\MyElectCourse\Images\online_left.gif
     文件         670  2007-03-05 17:25  网上选课\MyElectCourse\Images\online_middle.gif
     文件         923  2007-03-05 17:25  网上选课\MyElectCourse\Images\online_right.gif
     文件        3590  2007-03-05 17:25  网上选课\MyElectCourse\Login.aspx
     文件        3382  2007-03-05 17:25  网上选课\MyElectCourse\Login.aspx.cs
............此处省略28个文件信息

评论

共有 条评论