On Jun 1, 9:42 pm, "John" <i...@nospam.infovis.co.ukwrote:
Hi
I am trying to pass the asp.net membership username to the sqldatasource of
a gridview as below;
<asp:SqlDataSource ID="EventsSqlDataSource" runat="server"
ConnectionString="<%$ ConnectionStrings:MyConnStr %>" SelectCommand="SELECT
* FROM [MyTable] WHERE [Username] =
'<%Me.User.Identity.Name%>'"></asp:SqlDataSource>
It is not working. How can I do it correctly?
Thanks
Regards
Hi i have tried your same code and worked okay make be you are meesing
some thing....
here is the code i tried..
<asp:SqlDataSource ID="SqlDataSource1" runat="server"
ConnectionString="<%$ConnectionStrings:ConnectionS tring %>"
SelectCommand="SELECT * FROM [testtable] where id = '<%
Page.User.Identity.Name %>' "></asp:SqlDataSource>
Best of luck
Munna
www.munna.shatkotha.com www.munna.shatkotha.com/blog www.shatkotha.com