设为首页 加入收藏

TOP

csharp: Linq keyword example(一)
2019-09-03 01:38:25 】 浏览:89
Tags:csharp: Linq keyword example
/// <summary>
    /// http://www.dotnetperls.com/linq
    /// </summary>
    public partial class LinqForm : Form
    {

        const int _max = 1000000;
        /// <summary>
        /// Linq keyword
        /// </summary>
       public enum  CheckLinq
        {
            Distinct,
            Union,
            Intersect,
            Except,
            Var,
            Loop,
            New,
            Orderby,
            Group,
            Join,
            Let,
            Where,
            ToDictionary,
            Lambda,
            GroupJoin,
            GroupBy
        }
        /// <summary>
        /// 
        /// </summary>
        /// <returns></returns>
       DataTable setcom()
       {
           DataTable dt = new DataTable();
           dt.Columns.Add("id", typeof(int));
           dt.Columns.Add("name", typeof(string));
           dt.Rows.Add(1, "Distinct");
           dt.Rows.Add(2, "Union");
           dt.Rows.Add(3, "Intersect");
           dt.Rows.Add(4, "Except");
           dt.Rows.Add(5, "Var");
           dt.Rows.Add(6, "Loop");
           dt.Rows.Add(7, "New");
           dt.Rows.Add(8, "Orderby");
           dt.Rows.Add(9, "Group");
           dt.Rows.Add(10, "Join");
           dt.Rows.Add(11, "Let");
           dt.Rows.Add(12, "Where");
           dt.Rows.Add(13, "ToDictionary");
           dt.Rows.Add(14, "Lambda");
           dt.Rows.Add(15, "GroupJoin");
           dt.Rows.Add(16, "GroupBy");

           return dt;
       }

        /// <summary>
        ///
        /// </summary>
        public LinqForm()
        {
            InitializeComponent();
        }
        /// <summary>
        /// 
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void LinqForm_Load(object sender, EventArgs e)
        {
            this.comboBox1.DataSource = setcom();
            this.comboBox1.ValueMember = "id";
            this.comboBox1.DisplayMember = "name";

        }

        /// <summary>
        /// 
        /// </summary>
        public  string TestSetSemantics(CheckLinq check)
        {
            List<string> lstColumn = new List<string>();
            List<string> strDistinct = new List<string>();
            List<string> strUnion = new List<string>();
            List<string> strExcept = new List<string>();
            List<string> strIntersect = new List<string>();
            List<string> strVar = new List<string>();
            List<string> strLoop = new List<string>();
            List<string> strNew = new List<string>();
            List<string> strOrderby = new List<string>();
            List<string> strGroup = new List<string>();
            List<string> strJoin = new List<string>();
            List<string> strLet = new List<string>();
            List<string> strWhere = new List<string>();
            List<string> strToDictionary = new List<string>();
            List<string> strLambda = new List<string>();
            List<string> strGroupJoin = new List<string>();
            List<string> strGroupBy = new List<string>();

            string str = string.Empty;
           
            string[] dailySecurityLog = {
                   "Bob logged in",
                   "Bob logged out",
                   "Bob logged in",
                   "Bill logged in",
                   "Melissa logged in",
                   "Bob logged out",
                   "Bill logged out",
                   "Bill logged in",
                   "Tim logged in",
                   "Scott logged in",
                   "Scott logged out",
首页 上一页 1 2 3 4 5 6 下一页 尾页 1/6/6
】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
上一篇C#的百度地图开发(四)前端显示与.. 下一篇ASP.NET中利用DataList实现图片无..

最新文章

热门文章

Hot 文章

Python

C 语言

C++基础

大数据基础

linux编程基础

C/C++面试题目