Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

calling querystring within a db query syntax

Status
Not open for further replies.

ifntech

Programmer
Nov 4, 2004
80
US
This is what I was trying, the syntax will not run. What is the proper way to request myvalue within the select command.
VS underlines & myvalue &

<!--<script >
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs)
Dim myvalue as string = request.querystring("value")
End Sub
</script>-->
<asp:SqlDataSource ID="SqlDataSource" runat="server" ConnectionString="<%$ ConnectionStrings:testConnectionString1 %>"
ProviderName="<%$ ConnectionStrings:testConnectionString1.ProviderName %>" SelectCommand="SELECT * From table WHERE (table.column1 = N' & myvalue & '">
</asp:SqlDataSource>
 
well what object are you using the SqlDataSource with?
 
That's the code I use SqlDataSource with -

<asp:FormView
ID="FormView" runat="server" DataSourceID="SqlDataSource1">

<ItemTemplate>
<asp:Label ID="label"
Text='<%# Bind("column2")%>'></asp:Label>
</ItemTemplate>

</asp:FormView>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top