We help IT Professionals succeed at work.

We've partnered with Certified Experts, Carl Webster and Richard Faulkner, to bring you a podcast all about Citrix Workspace, moving to the cloud, and analytics & intelligence. Episode 2 coming soon!Listen Now

x

ControlParameter Error

Dovberman
Dovberman asked
on
Medium Priority
411 Views
Last Modified: 2012-06-27
I am trying to specify a datasource that gets an input parameter for a Stored Procedure from a control on a web page.

The gridview displays properly when all the parameters are defaulted and there are no controlparameters tags.

What am I missing?


Could not find control '"txtIncreaseCount' 
in ControlParameter 'Increases'
 
<asp:TextBox ID="txtIncreaseCount" runat="server" 
    Width="25px" SkinID ="textboxSkin">
</asp:TextBox>
 
    <asp:SqlDataSource ID="dscExceptions" runat="server" 
         ConnectionString="<%$ ConnectionStrings:StockSelectSQLConnectionString %>" 
         SelectCommand="usp_getPriceIncreases" 
         SelectCommandType="StoredProcedure">
         <SelectParameters>
?????            
<asp:controlparameter controlid = "txtIncreaseCount name="Increases" 
            propertyname = "Text" DefaultValue="15"/>
 
            <asp:Parameter Name="FromDate" Type = "DateTime" DefaultValue="2009-01-02" />
            <asp:Parameter Name="ToDate" Type = "DateTime" DefaultValue="2009-02-05" />
            <asp:controlparameter controlid="lstMarket" name="MarketID" 
            propertyname="SelectedValue" DefaultValue="0" />
         </SelectParameters>
	</asp:SqlDataSource>
 
---------
Stored Procedure
 
-- Insert statements for procedure here
	SELECT SYM.SymbolID,SYM.SymbolName,SYM.SecName  
	, Count(*) AS Increases  
	FROM StockHist AS HIST INNER JOIN
    Symbol AS SYM ON HIST.SymbolID = SYM.SymbolID 
	WHERE 
	SYM.MarketID = @MarketID  
	AND HIST.ClosePrice >=ClosePricePrev 
	AND HIST.QuoteDate >= @FromDate 
	AND HIST.QuoteDate <= @ToDate 
	GROUP BY SYM.SymbolID,SYM.SymbolName,SYM.SecName  
	Having count(*) > @Increases  
	ORDER BY Increases DESC

Open in new window

Comment
Watch Question

Analyst Programmer
Commented:
there is a miissing " ant the end of txtIncreaseCount
<asp:controlparameter controlid="txtIncreaseCount" name="Increases"
            propertyname = "Text" DefaultValue="15"/>
 
 

Not the solution you were looking for? Getting a personalized solution is easy.

Ask the Experts
Randy Wilson.Net Developer
Commented:
Your are missing a quote mark on the name txtIncreaseCount (look below)




 
   
         
?????            

                                                                Right here                        

 
           
           
           
         
      
 
---------
Stored Procedure
 
-- Insert statements for procedure here
      SELECT SYM.SymbolID,SYM.SymbolName,SYM.SecName  
      , Count(*) AS Increases  
      FROM StockHist AS HIST INNER JOIN
    Symbol AS SYM ON HIST.SymbolID = SYM.SymbolID
      WHERE
      SYM.MarketID = @MarketID  
      AND HIST.ClosePrice >=ClosePricePrev
      AND HIST.QuoteDate >= @FromDate
      AND HIST.QuoteDate <= @ToDate
      GROUP BY SYM.SymbolID,SYM.SymbolName,SYM.SecName  
      Having count(*) > @Increases  
      ORDER BY Increases DESC

Author

Commented:
Amazing, I looked at it 3 times.
Thanks,
Access more of Experts Exchange with a free account
Thanks for using Experts Exchange.

Create a free account to continue.

Limited access with a free account allows you to:

  • View three pieces of content (articles, solutions, posts, and videos)
  • Ask the experts questions (counted toward content limit)
  • Customize your dashboard and profile

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.