Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
170
Gantt Chart
posted

I have created a vb.net application for work and I want to use the Ganttview in this project. to start i simply want to get the data from SQL and place it on the chart. i only want at this stage 3 bits on information.

Job / Startdate /Duration. here is my code . can anyone please help as i really want to buy and use this product.

thanks inadvance.

 

----------------------------------------------------------------------------------------

Imports Infragistics.Win.UltraWinGanttView

Imports Infragistics.Win.UltraWinSchedule

Imports System.Data.SqlClient

Public Class Form1

 

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

 

        ' Call the method that creates a DataSet 

        Dim ds As DataSet = getdata()

 

        ' Set the BindingContextControl property to reference this form 

        Me.UltraCalendarInfo1.DataBindingsForTasks.BindingContextControl = Me

 

 

        ' Set the DataBinding members for Tasks

        Me.UltraCalendarInfo1.DataBindingsForTasks.SetDataBinding(ds, "Gantt")

 

        ' Basic Task properties 

        Me.UltraCalendarInfo1.DataBindingsForTasks.NameMember = "Job"

        Me.UltraCalendarInfo1.DataBindingsForTasks.DurationMember = "Days"

        Me.UltraCalendarInfo1.DataBindingsForTasks.StartDateTimeMember = "StartDate"

 

        Me.UltraGanttView1.CalendarInfo = Me.UltraCalendarInfo1

 

    End Sub

 

 

    Private Function getdata()

        Dim connetionString As String

        Dim connection As SqlConnection

        Dim command As SqlCommand

        Dim adapter As New SqlDataAdapter

        Dim ds As New DataSet

        Dim sql As String

 

        connetionString = "Data Source=ukwarapp02;Initial Catalog=DBSYS;User ID=sa;Password=mbl1175"

        sql = "select * from Gannt"

 

        connection = New SqlConnection(connetionString)

 

        Try

            connection.Open()

            command = New SqlCommand(sql, connection)

            adapter.SelectCommand = command

            adapter.Fill(ds, "Gantt)

            adapter.Dispose()

            command.Dispose()

            connection.Close()

 

        Catch ex As Exception

            MsgBox("Can not open connection ! ")

        End Try

        Return ds

    End Function

 

 

End Class

Parents Reply Children
No Data