日期:2014-05-20  浏览次数:20804 次

小毛病,帮忙看一下
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   :   System.Web.UI.Page
{
        protected   void   Page_Load(object   sender,   EventArgs   e)
        {
                //读取关键字
                try
                {
                        string   strCon   =   "Data   Source   =(local);Integrated   Security   =   SSPI;Initial   Catalog   =   EduDB; ";

                        SqlConnection   sqlCon   =   new   SqlConnection(strCon);
                        sqlCon.Open();
                        //key1
                        SqlCommand   cmdHotKey1   =   new   SqlCommand( "SELECT   HotKey   FROM   [TableHotkey]   where   ID   =   1 ",   sqlCon);
                        TextBoxHotKey1.Text   =   Convert.ToString(cmdHotKey1.ExecuteScalar());
                        //key2
                        SqlCommand   cmdHotKey2   =   new   SqlCommand( "select   HotKey   from   TableHotKey   where   ID   =   2 ",   sqlCon);
                        TextBoxHotKey2.Text   =   Convert.ToString(cmdHotKey2.ExecuteScalar());
                        //key3
                        SqlCommand   cmdHotKey3   =   new   SqlCommand( "select   HotKey   from   TableHotKey   where   ID   =   3 ",   sqlCon);
                        TextBoxHotKey3.Text   =   Convert.ToString(cmdHotKey3.ExecuteScalar());
                        //key4
                        SqlCommand   cmdHotKey4   =   new   SqlCommand( "select   HotKey   from   TableHotKey   where   ID   =   4 ",   sqlCon);
                        TextBoxHotKey4.Text   =   Convert.ToString(cmdHotKey4.ExecuteScalar());
                        //key5
                        SqlCommand   cmdHotKey5   =   new   SqlCommand( "select   HotKey   from   TableHotKey   where   ID   =   5 ",   sqlCon);