• 大小: 4.59M
    文件类型: .rar
    金币: 1
    下载: 0 次
    发布日期: 2023-09-19
  • 语言: 其他
  • 标签: 其他  

资源简介

MyElectCourse.rar

资源截图

代码片段和文件信息

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

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

     文件       1265  2007-03-05 17:25  Images\ADD.GIF

     文件       4945  2007-07-18 09:38  Images\Can.gif

     文件       1056  2007-03-05 17:25  Images\Close.GIF

     文件        505  2007-03-05 17:25  Images\CONFIRM.GIF

     文件       1584  2007-03-05 17:25  Images\FangKuai.gif

     文件       4945  2007-07-18 09:38  Images\from.gif

     文件       1073  2007-03-05 17:25  Images\Login.GIF

     文件        322  2007-03-05 17:25  Images\mm.gif

     文件        922  2007-03-05 17:25  Images\movetool1.gif

     文件        171  2007-03-05 17:25  Images\movetoolright1.gif

     文件        988  2007-03-05 17:25  Images\name.gif

     文件       1401  2007-03-05 17:25  Images\online_left.gif

     文件        670  2007-03-05 17:25  Images\online_middle.gif

     文件        923  2007-03-05 17:25  Images\online_right.gif

     文件       1242  2007-03-05 17:25  Images\QUERY.GIF

     文件       1221  2007-03-05 17:25  Images\RESET.GIF

     文件        505  2007-03-05 17:25  Images\RETURN.GIF

     文件       1209  2007-03-05 17:25  Images\SubmitScore.GIF

     目录          0  2008-04-14 15:12  Images

     文件       1777  2008-04-14 15:05  51aspx源码必读.txt

     文件       2330  2007-03-05 17:25  adminCourse.aspx

     文件       4908  2007-03-05 17:25  adminCourse.aspx.cs

     文件       9713  2007-03-05 17:25  adminCourseDetails.aspx

     文件       8518  2007-03-05 17:25  adminCourseDetails.aspx.cs

     文件       3516  2007-03-05 17:25  adminStudentAdd.aspx

     文件       2607  2007-03-05 17:25  adminStudentAdd.aspx.cs

     文件       4824  2007-03-05 17:25  adminStudentDetails.aspx

     文件       7906  2008-04-14 15:06  adminStudentDetails.aspx.cs

     文件       3574  2007-03-05 17:25  adminStudentScore.aspx

     文件       8329  2007-03-05 17:25  adminStudentScore.aspx.cs

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

评论

共有 条评论