让GridView只显示特定用户的数据的方法
发布时间:2020-03-15 21:28:26 所属栏目:Asp教程 来源:站长网
导读:GridView 只显示特定用户的数据
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函数获得的 (编辑:焦作站长网) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |