Hi, i have sql membership provider in my database and i want to join two different tables in sqldatasource i.e. i have this select statement in my aspx page.
<asp:SqlDataSource ID="Games" runat="server"
ConnectionString="<%$ ConnectionStrings:SecurityTutorialsConnectionString %>" SelectCommand="SELECT dbo.aspnet_Users.UserName, GameComment.Subject, GameComment.Body, GameComment.CommentDate, saquib.Reply.Subject, saquib.Reply.message From GameComment INNER JOIN dbo.aspnet_Users ON GameComment.UserId = dbo.aspnet_Users.UserId AND saquib.Reply.UserID = dbo.aspnet_Users.UserId ORDER BY GameComment.CommentDate DESC" />
their is three tables asp.net_users, GameComment and reply, should understand what i say on my above code.
and other query is that, i want to put the statement like that
<asp:SqlDataSource ID="Games" runat="server" ConnectionString="<%$ ConnectionStrings:NorthwindConnectionString %>"
SelectCommand=SELECT dbo.aspnet_Users.UserName, GameComment.Subject, GameComment.Body, GameComment.CommentDate, saquib.Reply.Subject, saquib.Reply.message From GameComment INNER JOIN dbo.aspnet_Users ON GameComment.UserId = dbo.aspnet_Users.UserId AND saquib.Reply.UserID = dbo.aspnet_Users.UserId ORDER BY GameComment.CommentDate DESC" >
</asp:SqlDataSource>
Please help me to solve this.
if you wish, i can show my database structure and relationship to you.
Thank you