I'm getting SqlDatasource
table from query string likes
<asp:SqlDataSource ID="myDataSource" runat="server" ConnectionString="<%$ ConnectionStrings:MyConnectionString %>"
SelectCommand="SELECT * FROM @DynamicTable D WHERE D.ID = @QueryId ">
<SelectParameters>
<asp:QueryStringParameter Name="DynamicTable" QueryStringField="TableName" Type="String" />
<asp:QueryStringParameter Name="QueryId" QueryStringField="ID" Type="String" />
</SelectParameters>
</asp:SqlDataSource>
But It's show me this error ,
Must declare the table variable "@DynamicTable"
How can I fix it ?
SelectCommand
is just an example , my realSelectCommand
long about 3 lines and I've to bind almost 10 tables dynamically , Rahul :( . Your link is useful for me but by this way , I'll have too many coding . Is there any different way ? Thanks Rahul :) – zey Jul 6 at 5:05