lookingatit
New Member
I'm creating a ListView in ASP.NET and have based mine on the example given by CodeProject here. I want to make the Select Command of the SqlDataSource dynamic so that a value is generated from one provided from the session. Ive tried a fue different possibilities, here is an example of what I want:\[code\]<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:TestDatabaseConnectionString %>" SelectCommand="SELECT * FROM [Contacts] WHERE [Name] = <%# Eval("value") %> " ></asp:SqlDataSource>\[/code\]How would I pass such a value using ASP? Ive also tried creating the query in the C# back page and linking to it like \[code\]SelectCommand = "<%# Eval("Query") %>"\[/code\] and also by using the \[code\]@value\[/code\] syntax. neither work!