让GridView只显示特定用户的数据的方法
更新时间:2008年10月30日 15:38:18 作者:
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函数获得的
改用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函数获得的
相关文章
详解在Windows下如何使用AspNetCore Api 和consul
这篇文章主要介绍了详解在Windows下如何使用AspNetCore Api 和consul,小编觉得挺不错的,现在分享给大家,也给大家做个参考。一起跟随小编过来看看吧2018-06-06
.NET Core应用类型(Portable apps & Self-contained apps)
这篇文章主要介绍了.NET Core应用类型,通常类型用来描述一个特定的执行模型或者基于此的应用,具有一定的参考价值,感兴趣的小伙伴们可以参考一下2017-04-04


最新评论