wrathyimp 0 Newbie Poster

I have a pages table with following columns:
DB Table:
sno name title url parentPage
1 Reports Reports http://1 0
2 Reports Local http://2 1
3 Reports Intl http://3 1

Now I need to to display the label as

Report - Local:

So report will be linked to the parentpage url, and Local will be link to sno=2 (which is http://2)

For now the Local link is working OK, but how to add label to have link for parent page?

Basically it will similar to Breadcrumb Navigation

So how can i have the Eval binded with the labels,

I mean where to define the sql command to get the url from the db table.

these are my code:

cs:

public String pid, dirrep, dirrep1, dirrep3, dirrep4;  
     SqlConnection sqlcon = new SqlConnection(ConfigurationManager.AppSettings["connString"]);  
    public void Page_Load(object sender, EventArgs e)  
     {  
         String pid = Request.QueryString["id"];  
         if (pid != null)  
         {  
             SqlCommand direct = new SqlCommand("select dir_reports from pages where sno=@pid", sqlcon);  
             direct.Parameters.Add(new SqlParameter("@pid", SqlDbType.Int, 4));  
             direct.Parameters["@pid"].Value = Convert.ToInt16(pid);  
             direct.Connection.Open();  
             dirrep = direct.ExecuteScalar().ToString();  
             ViewState["dir1"]=dirrep;  
             direct.Connection.Close();  
   
 //Label Gets it Text Content  
   
             SqlCommand direct1 = new SqlCommand("select title from pages where sno=@pid", sqlcon);  
             direct1.Parameters.Add(new SqlParameter("@pid", SqlDbType.Int, 4));  
             direct1.Parameters["@pid"].Value = Convert.ToInt16(pid);  
             direct1.Connection.Open();  
             String dirrep1 = direct1.ExecuteScalar().ToString();  
             direct1.Connection.Close();  
   
 //Label2 Get its text Content  
   
             SqlCommand direct2 = new SqlCommand("select content from pages where sno=@pid", sqlcon);  
             direct2.Parameters.Add(new SqlParameter("@pid", SqlDbType.Int, 4));  
             direct2.Parameters["@pid"].Value = Convert.ToInt16(pid);  
             direct2.Connection.Open();  
             String dirrep2 = direct2.ExecuteScalar().ToString();  
             direct2.Connection.Close();  
   
 //Parent Page URL  
   
             SqlCommand direct3 = new SqlCommand("select parent from pages where sno=@pid", sqlcon);  
             direct3.Parameters.Add(new SqlParameter("@pid", SqlDbType.Int, 4));  
             direct3.Parameters["@pid"].Value = Convert.ToInt16(pid);  
             direct3.Connection.Open();  
             String dirrep3 = direct3.ExecuteScalar().ToString();  
             direct3.Connection.Close();  
   
 // Page URL  
   
             SqlCommand direct4 = new SqlCommand("select parent from pages where sno=@pid", sqlcon);  
             direct4.Parameters.Add(new SqlParameter("@pid", SqlDbType.Int, 4));  
             direct4.Parameters["@pid"].Value = Convert.ToInt16(pid);  
             direct4.Connection.Open();  
             String dirrep4 = direct4.ExecuteScalar().ToString();  
             direct4.Connection.Close();  
   
             ViewState["dir1"] = dirrep;  
   
             label1.Text = dirrep1;  
             label2.Text = dirrep2;  
   
         }

ASPX:

<td style="width: 750px" align="left"><br>
    <a href='<%# Eval("direct3") %>'> 
            <asp:Label ID="label1" runat="server" Height="26px" Width="350px"  CssClass="Title" ForeColor="#585858"></asp:Label>
    </a>
</td>
<br> 
<td style="width: 750px" align="left"><br>
    <a href='<%# Eval("direct4") %>'> 
            <asp:Label ID="label2" runat="server" Height="26px" Width="350px"  CssClass="Title" ForeColor="#585858"></asp:Label>
    </a>
</td>

Thanks