selectcommand

Passing a outside variable into a <asp:sqldatasource> tag. ASP.NET 2.0

I'm designing some VB based ASP.NET 2.0, and I am trying to make more use of the various ASP tags that visual studio provides, rather than hand writing everything in the code-behind. I want to pass in an outside variable from the Session to identify who the user is for the query. <asp:sqldatasource id="DataStores" runat="server" connec...

SqlDataSource set SelectCommand dynamicly

I'm using a SqlDataSource and to avoid writing long queries directly in my code I thought I could make a Query class that returns the query I want as a string. I tried the code below but I just get "Server tags cannot contain <% ... %> constructs." Before I was using stored procedures but my webhosting doesn't allow that, so thats when...

Declaring an object of a conditional type with a System.Type

I am attempting to launch a specific form depending on the selected node of a treeview on the doubleclick event. The code I need to use to launch the form is a little bulky becuase I have to ensure that the form is not disposed, and that the form is not already open, before launching a new instance. I'd like to have all of this checkin...

Changing SqlDataSource.SelectCommand at runtime breaks pagination

I have a GridView bound to a SqlDataSource with a default SelectCommand defined as such: <asp:SqlDataSource ID="SqlDataSource1" runat="server" DataSourceMode="DataSet" ConnectionString="<%$ ConnectionStrings:MyConn %>" ProviderName="MySql.Data.MySqlClient" SelectCommand="select * from blah blah" /> There are cases ...

Using "SQL IN" in <asp:SelectCommand>

Hello Everyone!, I want to refresh GridView based upon whether a particular <asp:CheckBox> has been selected or not. I am using <asp:SqlDataSource with a SelectCommand and my query goes like this.. SelectCommand="SELECT * from [Table1] where [COL1] in (case when @checkbox=1 then 'FOO' else 'BAR')... and the <SelectParameters> have b...