Well, it's a bit complicated, but let me see if I can help you get pointed
in the right direction:

- SqlDataSources swallow errors (which is one reason I am firmly against
them in all but the most RAD environments).
- If you're sure the GetLotAttribute isn't being executed (SQL Profiler is
probalby your friend here), then look at the events for the data source to
get more information. If you hand the Selecting event, you can see the
command before it attempts to be executed (good for checking the state of
parameters).
- Normally it doesn't require data binding (e.g Page.DataBind()) if you are
using a DataSource but if there is a disconnect between the Grid and the
DataSource, the DataSource isn't called unless someone requests it. Could
you post the whole page's markup?


Thanks,

Shawn Wildermuth
Wildermuth Consulting Services, LLC
http://adoguy.com
C# MVP, MCSD.NET, Author and Speaker


> -----Original Message-----
> From: Discussion of advanced .NET topics.
> [mailto:[EMAIL PROTECTED] On Behalf Of
> Curt Hagenlocher
> Sent: Wednesday, August 16, 2006 8:01 PM
> To: [email protected]
> Subject: [ADVANCED-DOTNET] SqlDataSource
>
> I'm sorry for what's not a very advanced topic.
>
> I'm playing with creating a few quick-and-dirty web pages
> using the SqlDataSource control and the GridView.  I've got
> the following data source in my .aspx file:
>
> <asp:SqlDataSource ID="AttributeDataSource" runat="server"
>     ConnectionString="<%$ ConnectionStrings:AppConnectionString %>"
>     SelectCommand="GetLotAttributes"
>     SelectCommandType="StoredProcedure">
>     <SelectParameters>
>       <asp:Parameter DefaultValue="" Name="order_no"
> Type="String" Size="30"
> />
>     </SelectParameters>
> </asp:SqlDataSource>
> As written, my page loads empty with neither an error message
> nor an attempt to actually run the procedure against the
> database.  However, if I replace the current empty
> DefaultValue with one consisting of just a single space, then
> everything works the way I expect.
>
> What I'm wondering is:
> 1) What's going on behind the scenes that causes an empty
> value from being treated differently than a single space?
> 2) Do I need to enable some kind of super-sekrit debugging
> switch in order for the original version to show me an error?
> 3) Is there any way to trace what's going on during
> execution?  Or are the controls declared in the aspx file all
> opaque to the execution/debugging environment.
>
> --
> Curt Hagenlocher
> [EMAIL PROTECTED]
>
> ===================================
> This list is hosted by DevelopMentorR  http://www.develop.com
>
> View archives and manage your subscription(s) at
> http://discuss.develop.com

===================================
This list is hosted by DevelopMentorĀ®  http://www.develop.com

View archives and manage your subscription(s) at http://discuss.develop.com

Reply via email to