locked
Sticky in top of this forum RRS feed

  • Question

  • Hello,

    There is a sticky in top of this forum since 2008, I really don't understand it, I made the code more readable and then still I don't understand it. Is it really necessary that this is in top of this forum as a sticky 6 years?

    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using System.Threading.Tasks;
    using System.Data;
    
    namespace ConsoleApplication1
    {
        class Program
        {
            static void Main(string[] args)
            {
                DataTable dtCenter = new DataTable();
                dtCenter.Columns.Add(new DataColumn("Name", typeof(string)));
                dtCenter.Columns.Add(new DataColumn("A", typeof(int)));
                dtCenter.Columns.Add(new DataColumn("B", typeof(int)));
                dtCenter.Columns.Add(new DataColumn("C", typeof(int)));
                for (int i = 0; i < 1000; ++i)
                {
                    DataRow dr = dtCenter.NewRow();
                    dr["Name"] = i.ToString();
                    dr["A"] = i;
                    dr["B"] = i;
                    dr["C"] = i;
                    //System.Threading.Thread.Sleep(1);
                    dtCenter.Rows.Add(dr);
                }
                int startNumberOfOrs = 40;
                int endNumberOfOrs = 1000;
                int j = 0;
                for (j = startNumberOfOrs; j < endNumberOfOrs; j++)
                {
                    bool error = false;
                    try
                    {
                        Console.WriteLine(String.Format("Testing {0} number of OR's", j));
                        string sFilter = "Name IN (";
                        bool initial = true;
                        for (int i = 0; i < j; ++i)
                        {
                            if (initial)
                            {
                                sFilter += String.Format("'{0}'", i);
                                initial = false;
    
                            }
                            else
                                sFilter += String.Format(",'{0}'", i);
                        }
                        sFilter += " )";
                        dtCenter.DefaultView.RowFilter = sFilter;
                    }
                    catch (Exception)
                   {
                        error = true;
                    }
                    if (error)
                        Console.WriteLine("ERROR");
                    else
                        Console.WriteLine("SUCCESS");
                }
            }
        }
    }

    It is not a question I've seen more than once in a decade.


    Success
    Cor


    Monday, March 3, 2014 1:00 PM

Answers

  • Hello Cor,

    Thanks for your advice and it is cleared.

    Regards.


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    • Marked as answer by Cor Ligthert Tuesday, March 4, 2014 12:04 PM
    Tuesday, March 4, 2014 1:42 AM