title: how to append Navigate Url to tree view node
body: <p>i have one tree view that show summary of recently inserted questions. i have try to append NavigateUrl from databound event of tree view.</p>
  
  <p>here i include treeview:</p>
  
  <pre><code>&lt;asp:TreeView ID="TV_Question_Summary" runat="server" ImageSet="Simple" 
      ShowLines="True" ondatabound="TV_Question_Summary_DataBound"&gt;
          &lt;DataBindings&gt;
              &lt;asp:TreeNodeBinding DataMember="ParentNode" FormatString=" {0}" TextField="Inquiry_id" ValueField="Inquiry_id"/&gt;
              &lt;asp:TreeNodeBinding DataMember="Node" FormatString=" {0}" TextField="body" ValueField="Inquiry_id" /&gt;
          &lt;/DataBindings&gt;
  &lt;/asp:TreeView&gt;
  </code></pre>
  
  <p>and this code to bind inquiryid value to every node:</p>
  
  <pre><code> public void TV_Question_Summary_DataBound(object sender, TreeNodeEventArgs e)
      {
          e.Node.NavigateUrl = "~/Admin/OWM_Inquiry.aspx?inquiryid=" + e.Node.Value;
      }
  </code></pre>
  
  <p>how ever this error occured compiled time:</p>
  
  <pre><code>Error   3   No overload for 'TV_Question_Summary_DataBound' matches delegate 'System.EventHandler'  C:\Documents and Settings\Vishal\My Documents\Visual Studio 2005\WebSites\OmInvestmentStockMarketing_new\Admin\MasterPage.master    1   1   C:\...\OmInvestmentStockMarketing_new\
  </code></pre>
  
  <p><strong>--------------------------------Updated----------------------------</strong></p>
  
  <p>my stored procedure:</p>
  
  <pre><code>set ANSI_NULLS ON
  set QUOTED_IDENTIFIER ON
  GO
  ALTER PROCEDURE [dbo].[ViewSummaryOfQuestions]
  AS
  BEGIN
  SET NOCOUNT ON;
  SELECT tbl_Inquiry_History.Inquiry_id, tbl_Question.body
  FROM   tbl_Inquiry_History INNER JOIN
         tbl_Question ON tbl_Inquiry_History.Inquiry_id = tbl_Question.Inquiry_id
  WHERE(tbl_Question.IsCount='False')
  --UPDATE [OmStocks].[dbo].[tbl_Question]
     --SET [IsCount] = 'True'
  --WHERE (IsCount='False')
  END
  </code></pre>
  
  <p>and returned output:</p>
  
  <pre><code>-------------------------------------------------
  Inquiry_id      body
  -------------------------------------------------
  119 -CDNE-2013  i just want service ...
  119 -UXCY-2013  I just want to service please...
  119 -CDNE-2013  hurry up...
  -------------------------------------------------
  </code></pre>
  
  <p>for binding up this output to tree view i use this code:</p>
  
  <pre><code>void fill_Tree()
      {
          using (SqlConnection conn = Util.GetConnection())
          {
              conn.Open();
              SqlCommand SqlCmd = new SqlCommand("Select * from tbl_Inquiry_History", conn);
              SqlDataReader Sdr = SqlCmd.ExecuteReader();
              SqlCmd.Dispose();
              string[,] ParentNode = new string[100, 2];
              int count = 0;
              while (Sdr.Read())
              {
  
                  ParentNode[count, 0] = Sdr.GetValue(Sdr.GetOrdinal("Inquiry_id")).ToString();
                  ParentNode[count++, 1] = Sdr.GetValue(Sdr.GetOrdinal("Inquiry_id")).ToString();
  
              }
              Sdr.Close();
              for (int loop = 0; loop &lt; count; loop++)
              {
                  TreeNode root = new TreeNode();
                  root.Text = ParentNode[loop, 1];
                  //root.Target = "_blank";
                  root.NavigateUrl = "~/Admin/OWM_Inquiry.aspx?inquiryid="+ ParentNode[loop, 1];
                  SqlCommand Module_SqlCmd = new SqlCommand("Select * from tbl_Question where (Inquiry_id =" + ParentNode[loop, 0] + "AND IsCount='False')", conn);
                  SqlDataReader Module_Sdr = Module_SqlCmd.ExecuteReader();
                  while (Module_Sdr.Read())
                  {
                      TreeNode child = new TreeNode();
                      child.Text = Module_Sdr.GetValue(Module_Sdr.GetOrdinal("body")).ToString();
                      //child.Target = "_blank";
                      child.NavigateUrl = "~/Admin/OWM_Inquiry.aspx?inquiryid="+ParentNode[loop, 0];
                      root.ChildNodes.Add(child);
                  }
  
                  Module_Sdr.Close();
                  TV_Question_Summary.Nodes.Add(root);
  
              }
              TV_Question_Summary.CollapseAll();
          }
  
      }
  </code></pre>
  
  <p>but this gives me error like:</p>
  
  <p>Server Error in '/OmInvestmentStockMarketing_new' Application.</p>
  
  <p>Invalid column name 'CDNE'.</p>
  
  <p>Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. </p>
  
  <pre><code>Exception Details: System.Data.SqlClient.SqlException: Invalid column name 'CDNE'.
  
  Source Error: 
  
  
  Line 146:                root.NavigateUrl = "~/Admin/OWM_Inquiry.aspx?inquiryid="+ ParentNode[loop, 1];
  Line 147:                SqlCommand Module_SqlCmd = new SqlCommand("Select * from tbl_Question where (Inquiry_id =" + ParentNode[loop, 0] + "AND IsCount='False')", conn);
  Line 148:                SqlDataReader Module_Sdr = Module_SqlCmd.ExecuteReader();
  Line 149:                while (Module_Sdr.Read())
  Line 150:                {
  
  Source File: c:\Documents and Settings\Vishal\My Documents\Visual Studio 2005\WebSites\OmInvestmentStockMarketing_new\Admin\MasterPage.master.cs    Line: 148 
  
  Stack Trace: 
  
  
  [SqlException (0x80131904): Invalid column name 'CDNE'.]
     System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection) +1948826
     System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection) +4844747
     System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj) +194
     System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj) +2392
     System.Data.SqlClient.SqlDataReader.ConsumeMetaData() +33
     System.Data.SqlClient.SqlDataReader.get_MetaData() +83
     System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString) +297
     System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async) +954
     System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, DbAsyncResult result) +162
     System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method) +32
     System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior, String method) +141
     System.Data.SqlClient.SqlCommand.ExecuteReader() +89
     Admin_MasterPage.fill_Tree() in c:\Documents and Settings\Vishal\My Documents\Visual Studio 2005\WebSites\OmInvestmentStockMarketing_new\Admin\MasterPage.master.cs:148
     Admin_MasterPage.Page_Load(Object sender, EventArgs e) in c:\Documents and Settings\Vishal\My Documents\Visual Studio 2005\WebSites\OmInvestmentStockMarketing_new\Admin\MasterPage.master.cs:101
     System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +14
     System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +35
     System.Web.UI.Control.OnLoad(EventArgs e) +99
     System.Web.UI.Control.LoadRecursive() +50
     System.Web.UI.Control.LoadRecursive() +141
     System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +627
  
  Version Information: Microsoft .NET Framework Version:2.0.50727.3053; ASP.NET Version:2.0.50727.3053
  </code></pre>