讓GridView只顯示特定用戶的數(shù)據(jù)的方法
更新時間:2008年10月30日 15:38:18 作者:
GridView 只顯示特定用戶的數(shù)據(jù)
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ù)獲得的
改用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ù)獲得的
相關文章
詳解在Windows下如何使用AspNetCore Api 和consul
這篇文章主要介紹了詳解在Windows下如何使用AspNetCore Api 和consul,小編覺得挺不錯的,現(xiàn)在分享給大家,也給大家做個參考。一起跟隨小編過來看看吧2018-06-06
彈出窗口,點擊確定在刪除數(shù)據(jù)的實現(xiàn)方法
彈出窗口,點擊確定在刪除數(shù)據(jù)的實現(xiàn)方法,需要的朋友可以參考一下2013-04-04
.NET Core應用類型(Portable apps & Self-contained apps)
這篇文章主要介紹了.NET Core應用類型,通常類型用來描述一個特定的執(zhí)行模型或者基于此的應用,具有一定的參考價值,感興趣的小伙伴們可以參考一下2017-04-04
ASP.NET中操作SQL數(shù)據(jù)庫(連接字符串的配置及獲取)
要想在ASP.NET中操作SQL數(shù)據(jù)庫首先需要在WebConfig中配置數(shù)據(jù)庫連接字符串,之后在.cs文件中獲取連接字符串,具體的配置及獲取方法如下,感興趣的朋友可以參考下哈2013-06-06

