放幾個label,顯示使用者資料。
protected void page_load(object sender, eventargs e)
protected void binduserinfo()
using system;
using system.data;
using system.configuration;
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;
/// /// operatedata 的摘要說明
///
public class operatedata
/// /// 建立資料庫連線
///
/// 返回sqlconnection物件
public static sqlconnection createcon()
/// /// 返回一行資料
///
/// sql語句用來查詢一行資料
/// 返回sqldatareader物件
public static sqldatareader getrow(string sql)
/// /// 執行新增、刪除和更新資料操作
///
/// sql語句新增資料、刪除資料和更新資料
/// 返回乙個布林值,表示操作是否成功!
public static bool execsql(string sql)
else
}/// /// 返回多行資料
///
/// sql語句查詢出多行語句
/// 返回多行資料
public static datatable getrows(string sql)
/// /// 查詢資料是否在表中存在
///
/// sql語句查詢一行資料
/// 返回int型別大於1表示存在
public static int getcount(string sql)
/// /// 返回某乙個列的值
///
/// sql語句用來查詢某一列的值
/// 返回列值,該值為字串型別
public static string gettier(string sql)
/// /// 該方法用來實現登入查詢
///
/// 需要執行的sql語句
/// 登入名
/// 密碼
/// 返回乙個布林值,true表示登入成功false表示失敗
public static bool login(string sql, string name, string pass)
else
}}
於是你就可以讀取資料庫中的資料,在某頁面上顯示了。
BASH 如何讀取使用者輸入
bash 指令碼如何從使用者處讀取輸入呢?1.使用read命令 2.或者 read p answer me this answer 3.或者 read pre mid post 最簡單的方式就是直接使用 read 命令,這時,會將從使用者處讀取的輸入儲存到 shell 變數reply中。如果要讓 b...
Shell讀取使用者輸入
14.2 讀取使用者輸入上一章我們談到如何定義或取消變數,變數可被設定為當前shell的區域性變數,或是環境變數。如果您的shell指令碼不需要呼叫其他指令碼,其中的變數通常設定為指令碼內的區域性變數 參見第13.10節 變數 要獲取變數的值,在美元符後跟變數名即可。shell會對雙引號內的美元符後...
Shell讀取使用者輸入
14.2 讀取使用者輸入上一章我們談到如何定義或取消變數,變數可被設定為當前shell的區域性變數,或是環境變數。如果您的shell指令碼不需要呼叫其他指令碼,其中的變數通常設定為指令碼內的區域性變數 參見第13.10節 變數 要獲取變數的值,在美元符後跟變數名即可。shell會對雙引號內的美元符後...