?
Solved

ControlParameter Error

Posted on 2009-02-16
3
Medium Priority
?
397 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

0
Comment
Question by:Dovberman
3 Comments
 
LVL 18

Accepted Solution

by:
David Robitaille earned 500 total points
ID: 23653306
there is a miissing " ant the end of txtIncreaseCount
<asp:controlparameter controlid="txtIncreaseCount" name="Increases"
            propertyname = "Text" DefaultValue="15"/>
 
 
0
 
LVL 7

Assisted Solution

by:Randy Wilson
Randy Wilson earned 500 total points
ID: 23653324
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

0
 

Author Closing Comment

by:Dovberman
ID: 31547484
Amazing, I looked at it 3 times.
Thanks,
0

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Lots of people ask this question on how to extend the “MembershipProvider” to make use of custom authentication like using existing database or make use of some other way of authentication. Many blogs show you how to extend the membership provider c…
A quick way to get a menu to work on our website, is using the Menu control and assign it to a web.sitemap using SiteMapDataSource. Example of web.sitemap file: (CODE) Sample code to add to the page menu: (CODE) Running the application, we wi…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an anti-spam), the admin…
In a question here at Experts Exchange (https://www.experts-exchange.com/questions/29062564/Adobe-acrobat-reader-DC.html), a member asked how to create a signature in Adobe Acrobat Reader DC (the free Reader product, not the paid, full Acrobat produ…
Suggested Courses
Course of the Month15 days, 17 hours left to enroll

850 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question