Quantcast
Channel: DataSource Controls - SqlDataSource, ObjectDataSource, etc.
Viewing all articles
Browse latest Browse all 956

Need help with parameters in datasource

$
0
0

I do have something like this"

<asp:SqlDataSource ID="findAutoNumberSqlDataSource" runat="server" 
CancelSelectOnNullParameter="False" ConnectionString="<%$ ConnectionStrings:MainWebConnection %>" 
SelectCommand="SELECT AutoNumber FROM MainClassifieds WHERE (TEnterDate = (SELECT MAX(TEnterDate) AS Expr1 FROM MainClassifieds AS MainClassifieds_1 WHERE (TUserName = @gettingUserName,TItemName = @ItemTitle AND TListingComment = @ListingComment )))">
<SelectParameters>
<asp:ControlParameter Name="gettingUserName" ControlID="gettingUserName" PropertyName="Text" />


<asp:ControlParameter Name="ItemTitle" ControlID="ItemTitleTextBox" PropertyName="Text"/>
<asp:ControlParameter Name="ListingComment " ControlID="CommentTextBox" PropertyName="Text"/>

</SelectParameters>
</asp:SqlDataSource>

This parameter:   <asp:ControlParameter Name="gettingUserName" ControlID="gettingUserName" PropertyName="Text" /> is working fine, because is not include inside a form like the others two.

The others two parameters are link to a textbox, and these textboxes are inside a form called: FormViewDataEntry. So, the control parameter can not get the value from inside the form. Is there any way that I get a value to these two parameter from the corresponding textbox that are locate inside the form? How can I get the values from inside the form? Is it possible without using code behind?

Thanks


Viewing all articles
Browse latest Browse all 956

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>