讓GridView只顯示特定用戶的數(shù)據(jù)的方法
來源:懂視網(wǎng)
責編:小采
時間:2020-11-27 22:44:52
讓GridView只顯示特定用戶的數(shù)據(jù)的方法
讓GridView只顯示特定用戶的數(shù)據(jù)的方法:1、新建一個Label1來儲存username,這個是我這個方法成功的關鍵,因為我嘗試用Session(username)失敗。 改用control 來傳遞變量,成功! 2、GridView tasks--configure Data Source--一路next下去---到了Define Cus
導讀讓GridView只顯示特定用戶的數(shù)據(jù)的方法:1、新建一個Label1來儲存username,這個是我這個方法成功的關鍵,因為我嘗試用Session(username)失敗。 改用control 來傳遞變量,成功! 2、GridView tasks--configure Data Source--一路next下去---到了Define Cus

1、新建一個Label1來儲存username,這個是我這個方法成功的關鍵,因為我嘗試用Session("username")失敗。
改用control 來傳遞變量,成功!
2、“GridView tasks”--“configure Data Source”--一路next下去---到了“Define Custom Statements or Stored Procedures”窗口。把SQL Selete 語句
SELECT CourseId, Description, [Content], ContentType, ContentSize, Sendor, FileName, FileTime FROM Course
改為
SELECT CourseId, Description, [Content], ContentType, ContentSize, Sendor, FileName, FileTime FROM Course WHERE (Sendor = @username)
2、點Next到如下窗口,設置如圖:

最后:我的username都是用Membership函數(shù)獲得的
聲明:本網(wǎng)頁內(nèi)容旨在傳播知識,若有侵權等問題請及時與本網(wǎng)聯(lián)系,我們將在第一時間刪除處理。TEL:177 7030 7066 E-MAIL:11247931@qq.com
讓GridView只顯示特定用戶的數(shù)據(jù)的方法
讓GridView只顯示特定用戶的數(shù)據(jù)的方法:1、新建一個Label1來儲存username,這個是我這個方法成功的關鍵,因為我嘗試用Session(username)失敗。 改用control 來傳遞變量,成功! 2、GridView tasks--configure Data Source--一路next下去---到了Define Cus