Click here to Skip to main content
13,594,513 members
Click here to Skip to main content
Articles » Languages » C# » Generics » Downloads

Stats

101.1K views
3.2K downloads
28 bookmarked
Posted 23 May 2010
Licenced CPOL

Convert a Generic List to a Datatable

, 23 May 2010
A Generic List with a feature of converting itself to a DataTable
GenericList
App_Code
App_Data
GenericList (2).sln.ccexclude
GenericList (2).suo
Web.Config
using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

/// <summary>
/// Summary description for User
/// </summary>
public class User
{
    string strName;
    string strAge;

    public string Name
    {
        get
        {
            return strName;
        }
        set
        {
            strName = value;
        }
    }

    public string Age
    {
        get
        {
            return strAge;
        }
        set
        {
            strAge = value;
        }
    }

    #region COnstructor
    public User(string name, string age)
    {
        Name = name;
        Age = age;
    }
    #endregion
}

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)

Share

About the Author

Abhijeet Singhai
Software Developer
India India
I am a Bachelor of Engineering in Information Technology.

You may also be interested in...

Permalink | Advertise | Privacy | Cookies | Terms of Use | Mobile
Web02-2016 | 2.8.180621.3 | Last Updated 23 May 2010
Article Copyright 2010 by Abhijeet Singhai
Everything else Copyright © CodeProject, 1999-2018
Layout: fixed | fluid