Wie kann ich Request.QueryString in einer select * from variable
Abfrage in Variable setzen?Wie setze ich Request.QueryString in Variable in * aus Variable
Hier ist, wie ich versuche, es zu tun:
<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:conn %>" SelectCommand="SELECT [pm1], [s1], [i1], [j1] FROM ([pk1] = @pk1)">
<SelectParameters>
<asp:QueryStringParameter Name="pk1" QueryStringField="pk1" DbType = "String" Direction = "Input" />
</SelectParameters>
</asp:SqlDataSource>
Aber das gibt mir die folgende Fehlermeldung:
Incorrect syntax near '='.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Data.SqlClient.SqlException: Incorrect syntax near '='.
Nun, SQL-Definition ist falsch: 'SELECT Felder FROM Tabelle' ist korrekt, aber nicht' SELECT Felder FROM Tabelle = Param1'. Fehle ich etwas? – Marco
Ich möchte Parameter von URL als Tabelle verwenden – ragnat