⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 serfind.aspx.cs

📁 简单的系统评分源代码
💻 CS
字号:
using System;
using System.Data;
using System.Data.OleDb;
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;

public partial class SerFind : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
            cmdSerFind.Enabled = false;
    }
    public DataSet btnSerbind(string _Table)
    {
        int txtkey = Convert.ToInt32(txtSerData.Text.Trim());
        string field = this.DropDownList1.SelectedValue.ToString();
        string StrCommand = "select db_Score from db_Grade where db_GroupID = "+txtkey+"";
        OleDbConnection oleConnection = new OleDbConnection(ConfigurationManager.AppSettings["ConnectionString"].ToString() + System.Web.HttpContext.Current.Server.MapPath(ConfigurationManager.AppSettings["dpPath"]).ToString() + ";");
        OleDbCommand oleCommand = new OleDbCommand(StrCommand, oleConnection);
        oleConnection.Open();

        try
        {
            oleCommand.ExecuteNonQuery();
            OleDbDataAdapter da = new OleDbDataAdapter(oleCommand);
            DataSet ds = new DataSet();
            da.Fill(ds, _Table);
            return ds;
        }
        catch (Exception ex)
        {
            throw (ex);
        }
        finally
        {
            oleCommand.Dispose();
            oleConnection.Close();
        }
    }
    protected void cmdSerFind_Click(object sender, EventArgs e)
    {
        DataSet ds = btnSerbind("abcinfo");
        if (txtSerData.Text != "")
        {
            lblResult.Text = ds.Tables["abcinfo"].Rows[0][0].ToString();
        }
        else
        {
            Response.Write("<script>alert('请输入查找的数据!');location('SerFind.aspx');</script>");
        }
    }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -