[x]
Posted via EE Mobile

Search, ask, and monitor your questions on the go with EE Mobile. Visit Experts Exchange from your mobile device and never be out of touch again.

01/19/2008 at 01:39PM PST, ID: 23096068
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

7.4

Add Tree View values from a database

Asked by sebastiz in .NET, Microsoft Visual Basic.Net, Programming for ASP.NET

Tags: vb.net asp.net

I want to show a treeview control in visual studio 2005 (or 2008) which shows the date a task was done and when it is clicked on it also shows all the task IDs done on that date. The database is a MySQL database and stores datetime values so I've had to convert these to date values. The values for TaskID and TimePosted (the dateTime field) are in the same table. The problem is I can get the date to be listed, but I cant get all the tasks done on that date to be listed as child nodes. The code is below. Can anyone help?

Imports System.Data.Odbc
Imports System.Data.SqlClient
Imports System.Data



Partial Class tbbDocumentExpl
    Inherits System.Web.UI.Page

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        Dim strConn As String = "DATABASE=blabla;DESCRIPTION=blabla;DSN=blabla;OPTION=0;PORT=0;SERVER=xxxxxxx;UID=xxx"


        Dim objConn As New OdbcConnection(strConn)
        Dim objDS As New DataSet
        Dim s As String = "'sebastiz'"
        'Dim s As String = "'" & System.Web.HttpContext.Current.Session("seb") & "'"

        Dim daTask As New OdbcDataAdapter("SELECT TaskID, SecretaryID, date_format(TimePosted,'%W %M %Y')as Newdate FROM Task GROUP BY Newdate", objConn)
        Dim daUser As New OdbcDataAdapter("SELECT UserName, UserID FROM User WHERE UserName=" & s, objConn)
        Dim daSec As New OdbcDataAdapter("SELECT SecretaryID, UserID FROM Secretary", objConn)

        daTask.Fill(objDS, "dtTask")
        daUser.Fill(objDS, "dtUser")
        daSec.Fill(objDS, "dtSec")
        objConn.Close()
        objDS.Relations.Add("TaskToSec", _
            objDS.Tables("dtSec").Columns("SecretaryID"), objDS.Tables("dtTask").Columns("SecretaryID"), False)
        objDS.Relations.Add("SecToUser", _
            objDS.Tables("dtUser").Columns("UserID"), _
            objDS.Tables("dtSec").Columns("UserID"), False)

        Dim nodeUser, nodeTask As TreeNode
        Dim rowUser, rowTask, rowsecretary, rowdate As DataRow

        Try
            For Each rowdate In objDS.Tables("dtTask").Rows
                nodeUser = New TreeNode
                nodeUser.Text = rowdate("Newdate")
                TreeView1.Nodes.Add(nodeUser)
                For Each rowdate("Newdate") In objDS.Tables("dtTask").Rows
                    nodeTask = New TreeNode
                    nodeTask.Text = rowTask("TaskID")
                    nodeUser.ChildNodes.Add(nodeTask)

                Next
           
             
            Next
        Catch ex As Exception

        End Try

        Try


            Dim dr As OdbcDataReader
            Dim str As String = TreeView1.SelectedNode.Text
            'Dim daTask As New OdbcDataAdapter("SELECT TaskID,Transcript SecretaryID FROM Task WHERE TaskID='" & s & "'", objConn2)
            'daTask.Fill(objDS, "dtTask")

            Dim comm As New OdbcCommand("SELECT Transcript, TimePosted FROM Task WHERE TaskID='" & str & "'", objConn)
            objConn.Open()
            dr = comm.ExecuteReader()
            dr.Read()
            TextBox1.Text = dr("Transcript").ToString
            objConn.Close()

        Catch ex As Exception

        End Try



        objDS.Dispose()
        daTask.Dispose()
        daUser.Dispose()
        daSec.Dispose()
       
        objConn.Dispose()
    End Sub

End Class
[+][-]01/21/08 02:46 AM, ID: 20704949

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]01/21/08 09:48 PM, ID: 20712159

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]01/23/08 12:33 PM, ID: 20727366

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]01/23/08 08:23 PM, ID: 20730582

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]01/26/08 11:32 AM, ID: 20750917

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]01/27/08 10:05 PM, ID: 20757118

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]02/01/08 06:34 AM, ID: 20796805

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]02/03/08 11:48 PM, ID: 20812561

View this solution now by starting your 30-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: .NET, Microsoft Visual Basic.Net, Programming for ASP.NET
Tags: vb.net asp.net
Sign Up Now!
Solution Provided By: AUmidh
Participating Experts: 2
Solution Grade: A
 
 
[+][-]04/01/08 12:33 AM, ID: 21251901

Experts Exchange has a courteous staff of administrators who help members get the most out of the website by means of administrative comments like this one.

Start your 30-day free trial to view this Administrative Comment or ask the Experts your question.

 
 
Loading Advertisement...
20090824-EE-VQP-74 / EE_QW_2_20070628