Esempio n. 1
0
        /// <summary>
        /// 点击编号管理;
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void Menu1_MenuItemClick1(object sender, MenuEventArgs e)
        {
            sQLMHXY.openDatabase();
            //配置sql语句
            string         sqlStr = "SELECT TOP 1000 [ID],[NAME] ,[PASSWORD]  FROM [MHXY].[dbo].[login]"; //初始化查询所有编号
            SqlDataAdapter da     = sQLMHXY.gridViewData(sqlStr);

            sQLMHXY.closeDatabase();
            DataSet data = new DataSet();

            da.Fill(data, "table");
            this.GridView1.DataSource = data;
            this.GridView1.DataBind();
            Session["TaskTable"] = data;
        }
Esempio n. 2
0
        /// <summary>
        /// 查询表格并填充
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void Button5_Click(object sender, EventArgs e)
        {
            SQLMHXY sQLMHXY = new SQLMHXY();

            sQLMHXY.openDatabase();
            //配置sql语句,查询登录表所有信息
            string         sqlStr = System.Configuration.ConfigurationManager.AppSettings["sqlLogin1"].ToString();
            SqlDataAdapter da     = sQLMHXY.gridViewData(sqlStr);

            sQLMHXY.closeDatabase();
            DataSet data = new DataSet();

            da.Fill(data, "table");
            this.GridView1.DataSource = data;
            this.GridView1.DataBind();
        }