ASPForums.Net RSS Feed additions to the content that appears on ASPForums.Net(c) 2019 All rights<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>, 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>, 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>, 12 Feb 2012 22:33:31 GMTsearch<p>Create following sp in Sql Database</p> <p>For&nbsp;refe : <a href=""></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;;></a></pre> <p>&nbsp;</p>, 12 Feb 2012 23:30:02 GMTsearch<p>tanx alot</p> <p>i do it</p> <p>&nbsp;</p>, 13 Feb 2012 01:51:36 GMT