Click here to Skip to main content
15,891,629 members
Articles / Web Development / ASP.NET

Project Management Using Gantt Chart

Rate me:
Please Sign up or sign in to vote.
4.91/5 (46 votes)
23 Apr 2012CPOL5 min read 120.9K   7.7K   81  
A simple way to manage a project and show progress on a Gantt chart.
//(c) Copyright Microsoft Corporation.
//This source is subject to the Microsoft Public License.
//See http://www.microsoft.com/opensource/licenses.mspx#Ms-PL.
// All other rights reserved.
//*-------------------------------*
//*                               *
//*      Mahsa Hassankashi        *
//*   mahsa.hassankashi@gmail.com *
//*     kashi_mahsa@yahoo.com     * 
//*                               *
//*                               *
//*-------------------------------*
using System;
using System.Collections;
using System.Linq;
using System.Web;
using System.Web.Services;
using System.Web.Services.Protocols;
using System.Xml.Linq;
using System.Collections.Generic;
using System.Data;
using System.Data.SqlClient;

///<summary>
/// Summary description for AutoComplete
///</summary>

[WebService(Namespace = "http://tempuri.org/")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
// To allow this Web Service to be called from script, using ASP.NET AJAX, 
// uncomment the following line.
[System.Web.Script.Services.ScriptService]
public class GroupAutoComplete : System.Web.Services.WebService {

    public GroupAutoComplete()
    {

        //Uncomment the following line if using designed components
        //InitializeComponent();
    }

    [WebMethod]
    public string[] GetCompletionList(string prefixText, int count)
    {
        //ADO.Net
        SqlConnection cn =new SqlConnection();
        DataSet ds = new DataSet();
        DataTable  dt = new DataTable();
        String strCn = "data source=.;Initial Catalog=MyDB;Integrated Security=True";
        cn.ConnectionString = strCn;
        SqlCommand cmd = new SqlCommand();
        cmd.Connection = cn;
        cmd.CommandType = CommandType.Text;
        //Compare String From Textbox(prefixText) AND String From 
        //Column in DataBase(TaskName)
        //If String from DataBase is equal to String from TextBox(prefixText) 
        //then add it to return ItemList
        //-----I defined a parameter instead of passing value directly to 
        //prevent SQL injection--------//
        cmd.CommandText = "select * from tbl_Task Where Task_Name like @myParameter";
        cmd.Parameters.AddWithValue("@myParameter", "%" + prefixText + "%");

        try
        {
            cn.Open();
            cmd.ExecuteNonQuery();
            SqlDataAdapter da = new SqlDataAdapter(cmd);
            da.Fill(ds);
        }
        catch
        {
        }
        finally
        {
            cn.Close();
        }
        dt = ds.Tables[0];

	    //Then return List of string(txtItems) as result
        List<string> txtItems =new List<string>();
        String  dbValues;

        foreach (DataRow row  in dt.Rows)
        {
             //String From DataBase(dbValues)
            dbValues = row["Task_Name"].ToString();
            dbValues = dbValues.ToLower();
            txtItems.Add(dbValues);
        }

        return txtItems.ToArray();
    }
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Doctorandin Technische Universität Berlin
Iran (Islamic Republic of) Iran (Islamic Republic of)
I have been working with different technologies and data more than 10 years.
I`d like to challenge with complex problem, then make it easy for using everyone. This is the best joy.

ICT Master in Norway 2013
Doctorandin at Technische Universität Berlin in Data Scientist ( currently )
-------------------------------------------------------------
Diamond is nothing except the pieces of the coal which have continued their activities finally they have become Diamond.

http://www.repocomp.com/

Comments and Discussions