I am trying to retrieve database info that is specific to currently logged-in user.
The following 3 lines let me know that var1 is correct (As it displays it on the page)
Dim var1 As String<Br>
var1 = LoginName1.Page.User.Identity.Name<br>
Response.Write(var1)
But, when I try to use var1 as a parameter it is not working.... just wondered what I am missing.
<asp:SqlDataSource ID="SqlDataSource1" runat="server"
ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
SelectCommand="SELECT aspnet_Clubs.ClubName FROM aspnet_Clubs INNER JOIN aspnet_Users ON aspnet_Clubs.ClubID = aspnet_Users.ClubLinkID WHERE (aspnet_Users.UserName = @var1 )">
</asp:SqlDataSource>
<asp:DetailsView ID="DetailsView1" runat="server" AutoGenerateRows="False"
BackColor="LightGoldenrodYellow" BorderColor="Tan" BorderWidth="1px"
CellPadding="2" DataSourceID="SqlDataSource1" ForeColor="Black"
GridLines="None" Height="50px" Width="274px">
<AlternatingRowStyle BackColor="PaleGoldenrod" />
<EditRowStyle BackColor="DarkSlateBlue" ForeColor="GhostWhite" />
<Fields>
<asp:BoundField DataField="ClubName" HeaderText="ClubName"
SortExpression="ClubName" />
</Fields>
<FooterStyle BackColor="Tan" />
<HeaderStyle BackColor="Tan" Font-Bold="True" />
<PagerStyle BackColor="PaleGoldenrod" ForeColor="DarkSlateBlue"
HorizontalAlign="Center" />
</asp:DetailsView>