I'm using c#, .net for my application and connecting to SQL 2012.
I'm having a hard time finding information on how to move this SQLDataSource select statement to the code code behind C# file and referencing it in my aspx page.
This is the reference in my aspx file. How do I move the select statement to my .cs file?
<asp:SqlDataSource ID="SqlDS" runat="server"
ConnectionString="<%$ ConnectionStrings:MyConnectionString %>"
SelectCommand="SELECT S.IsActive, S.Title, S.AllowTransfer, S.GuestFee
FROM Sessions S WHERE (IsActive = 'True') AND (AllowTransfer = 'True')">
Thanks for looking at this.