hi friends.... i am creating a new website in ASP.NET...i have 4 tables in database......test1,test2,test3,testnames...and testnames contain one column "tno" which contain entry as test1,test2 and test3(the name of another tables). and it also contain table of names of tests(related to test1,test2,test3)..now i want to show the table name on one page and on clicking on this name the nest page should shows the data into table related to that name(test1,test2,test3)... ...i have a query .. select * from test1 but i want that it should pick the table name(test1,test2,test3) from table testnames on clicking the name.... i hope question is clear, if not you can ask me
No, your question is not clear What are you trying to achieve ? Why would you want to store tables name in database ? Your problem must be solved using unique IDs, i guess Read more about relationships between database tables
The link that the user clicks should be created with a querystring (e.g. nextpage.aspx?cnt=table1). On nextpage, get the value of cnt (whichin this case is table1) and get the data for table1 in the page_load event.
Or using querystrings just add a parameter to a sqldatasource control and bind it to the relevant control <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString = "<%$ ConnectionStrings:ConnectionString" %>" SelectCommand = "Select * from @TableName;"> <SelectParameters> <asp:QueryStringParameter Name="TableName" QueryStringField="cnt" Type="String" /> </SelectParameters> </asp:SqlDataSource> PHP: