hi every one i have problem in my search engine please help me i confuse every thing
I have 1 Textbox 1 Button and 1 Gridview in my page search.aspx and I have some Table in my DB
1-TRADE TABLE
Key word
|
Name
|
T_code
|
ID
|
Furniture
|
Furniture
|
11
|
1
|
chair
|
Furniture
|
11
|
2
|
Sofa
|
Furniture
|
11
|
3
|
Book
|
Book
|
22
|
4
|
Library
|
Book
|
22
|
5
|
Printery
|
Book
|
22
|
6
|
2-Furniture Table
Name
|
Code
|
ID
|
Furniture production
|
111
|
1
|
Buy furniture
|
222
|
2
|
3-Book Table
name
|
code
|
id
|
Library
|
1111
|
1
|
Printery
|
2222
|
2
|
and every data in name column has other table that contain some information
EX:Library table
I have 3 page in my wesite 1-search.aspx 2-furniture.aspx 3-book.aspx
ok at first I write word in my TB it search in my Tarde table from keyword column and Depending on the choice It show Furniture or book Tables column in gridview.That show as hyperlink.
Up to now i dont have any problem .I want when in my gridview show Furniture Table column when user click hyperlink it go to Furniture.aspx and if in Gridview show Book table column when user click hyperlink it go to Book.aspx.
How i can do it?
and it is my code on my search page
SqlConnection _cn = new SqlConnection(System.Web.Configuration.WebConfigurationManager.ConnectionStrings["behtopConnectionString"].ConnectionString);
SqlCommand _cm2 = new SqlCommand("Trade", _cn);
_cm2.CommandType = CommandType.StoredProcedure;
_cm2.Parameters.Add("@Keyword", txtsearch.Text);
if (_cn.State != System.Data.ConnectionState.Open) _cn.Open();
SqlDataReader _dr = _cm2.ExecuteReader();
while (_dr.Read())
{
GridView1.DataSource = _dr;
GridView1.DataBind();
}
if (_cn.State != System.Data.ConnectionState.Closed) _cn.Close();