当前上下文中不存在名称"BaseClass"

usingSystem;usingSystem.Data;usingSystem.Configuration;usingSystem.Collections;usingS... 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 admin_Subject : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
if (Session["admin"] == null)
{
Response.Redirect("../Login.aspx");
}
if (!IsPostBack)
{
SqlConnection conn = BaseClass.DBCon();
此处的BaseClass

conn.Open();
SqlCommand cmd = new SqlCommand("select * from tb_Lesson", conn);
SqlDataReader sdr = cmd.ExecuteReader();
while (sdr.Read())
{
ListBox1.Items.Add(sdr["LessonName"].ToString());
}
}
}
protected void btnAdd_Click(object sender, EventArgs e)
{
if (txtKCName.Text == "")
{
MessageBox.Show("请输入课程名称");
return;
}
else
{
string systemTime = DateTime.Now.ToString();
string strsql = "insert into tb_Lesson(LessonName,LessonDataTime) values('" + txtKCName.Text.Trim() + "','" + systemTime + "')";
BaseClass.OperateData(strsql);
txtKCName.Text = "";
Response.Write("<script>alert('添加成功');location='Subject.aspx'</script>");
}
}
protected void btnDelete_Click(object sender, EventArgs e)
{
if (ListBox1.SelectedValue.ToString() == "")
{
MessageBox.Show("请选择删除项目后删除");
return;
}
else
{
string strsql = "delete from tb_Lesson where LessonName='" + ListBox1.SelectedItem.Text + "'";
BaseClass.OperateData(strsql);
Response.Write("<script>alert('删除成功');location='Subject.aspx'</script>");
}
}
}
展开
 我来答
帐号已注销
2008-08-13 · TA获得超过154个赞
知道小有建树答主
回答量:404
采纳率:0%
帮助的人:325万
展开全部
哥们你发错地方了..
已赞过 已踩过<
你对这个回答的评价是?
评论 收起
推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

下载百度知道APP,抢鲜体验
使用百度知道APP,立即抢鲜体验。你的手机镜头里或许有别人想知道的答案。
扫描二维码下载
×

类别

我们会通过消息、邮箱等方式尽快将举报结果通知您。

说明

0/200

提交
取消

辅 助

模 式