我正在尝试在页面上加载某些特定信息,具体取决于登录用户加载页面的内容。我尽力使用谷歌搜索我的问题,但我找不到解决方案。
<asp:SqlDataSource ID="SqlDataSource1" runat="server"
ConnectionString="<%$ ConnectionStrings:werknem taken connection string %>"
SelectCommand="SELECT [Description], [State], [assessment] FROM [TaskInfo] WHERE ([EmployeeID] = @EmployeeID)">
<SelectParameters>
<asp:Parameter DefaultValue="" Name="@EmployeeID" Type="String" />
</SelectParameters>
</asp:SqlDataSource>
并且
Imports System.Data.SqlClient
Imports System.Data
Partial Class werknemer
Inherits System.Web.UI.Page
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
SqlDataSource1.SelectParameters.Add("@EmployeeID", User.Identity.Name)
GridView1.DataBind()
End Sub
End Class
非常感谢一些帮助。