I have really weird situation. I\'ve created new aspx page, and without using ANY custom logic objects (everything created with visual studios wizards) tried to create grid
From your recent comments it looks as though SQL Profiler isn't showing any activity when the SelectCommand
is issued from the SqlDataSource
. This could be due to the fact that ConvertEmptyStringToNull
is set to true by default on Parameters contained in the SelectParameters
collection. Also, by default, the CancelSelectOnNullParameter
on the SqlDataSource is set to true. This means that your 'val2' parameter is probably passing a NULL value, which in turn cancels the data retrieval operation. This is why you don't see any activity within SQL Profiler.
Try setting CancelSelectOnNullParameter
to false on the SqlDataSource
.
<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$
ConnectionStrings:myConnectionString %>" SelectCommand="myStoredProcedure"
SelectCommandType="StoredProcedure" CancelSelectOnNullParameter="False">
</asp:SqlDataSource>
I haven't see assignment of parameters(val1, val2), so default launch will assign default for string and int and pass to SQL server.
Try SQL Server Profiler to see if you execute selection with REAL parameters