ASPForums.Net RSS Feedhttp://www.aspforums.net/Handlers/RSS.ashxLatest additions to the content that appears on ASPForums.Net(c) 2019 www.aspforums.com. All rights reserved.search<p>you need to create following two procedur</p> <p>&nbsp;</p> <p>&nbsp;</p> <pre class="brush: sql">CREATE PROCEDURE SP_GetTableCode @Key varchar(50)ASBEGIN SET NOCOUNT ON; select T_Code from tradeTable where Keword= @Key END</pre> <pre class="brush: sql">&nbsp;</pre> <pre class="brush: sql">&nbsp;</pre> <pre class="brush: sql">&nbsp;</pre> <p>&nbsp;</p> <pre class="brush: sql">CREATE PROCEDURE SP_GetDetails @T_Code intASBEGIN SET NOCOUNT ON; if @T_Code = 1 begin select * from HotelTable end else if @T_Code = 2 begin select * from tranigtable endEND</pre> <p>&nbsp;</p>https://www.aspforums.net:443/Threads/167754/search/https://www.aspforums.net:443/Threads/167754/search/Sat, 11 Feb 2012 05:09:35 GMTsearch<p>hi</p> <p>I am&nbsp; novice in sql i cant Understand what are these code?</p> <p>1-where should i put these code in my website page in my</p> <p>&nbsp;</p> <p>&nbsp;&nbsp;&nbsp; protected void serach_Click(object sender, EventArgs e)</p> <p>{</p> <p>}</p> <p>&nbsp;</p> <p>2-are there other code instead of these procedur?<br /><br /></p>https://www.aspforums.net:443/Threads/167754/search/https://www.aspforums.net:443/Threads/167754/search/Sat, 11 Feb 2012 21:43:38 GMTsearch<p>This is the query you need</p> <p>&nbsp;</p> <pre class="brush: sql">declare @tcode int select @tcode = t_code from Trade table if tcode = 1 begin select hotelname from hotel end if tcode = 2 begin select trainingName from training end </pre> <p>&nbsp;</p>https://www.aspforums.net:443/Threads/167754/search/https://www.aspforums.net:443/Threads/167754/search/Sun, 12 Feb 2012 22:33:31 GMTsearch<p>Create following sp in Sql Database</p> <p>For&nbsp;refe : <a href="http://www.aspsnippets.com/Articles/Using-Stored-Procedures-in-SQL-Server-Database.aspx">http://www.aspsnippets.com/Articles/Using-Stored-Procedures-in-SQL-Server-Database.aspx</a></p> <p>&nbsp;</p> <pre class="brush: sql">SET ANSI_NULLS ONGOSET QUOTED_IDENTIFIER ONGOCREATE PROCEDURE GetDetails @KeyWord varchar(50)ASBEGIN SET NOCOUNT ON;Declare @TCode int Select @TCode = T_code from Trade where KeyWord = @KeyWordIf @TCode =1 Begin Select * from HotelEnd If @ TCode =2BeginSelect * from trainingEnd END</pre> <pre class="brush: sql">&nbsp;</pre> <pre class="brush: sql">Call this SP in your Search_Click Event</pre> <pre class="brush: sql">For Refe : <a href=&#34;http://www.aspsnippets.com/Articles/Calling-Select-SQL-Server-Stored-Procedures-using-ADO.Net.aspx&#34;>http://www.aspsnippets.com/Articles/Calling-Select-SQL-Server-Stored-Procedures-using-ADO.Net.aspx</a></pre> <p>&nbsp;</p>https://www.aspforums.net:443/Threads/167754/search/https://www.aspforums.net:443/Threads/167754/search/Sun, 12 Feb 2012 23:30:02 GMTsearch<p>tanx alot</p> <p>i do it</p> <p>&nbsp;</p>https://www.aspforums.net:443/Threads/167754/search/https://www.aspforums.net:443/Threads/167754/search/Mon, 13 Feb 2012 01:51:36 GMT