コード例 #1
0
ファイル: Form1.cs プロジェクト: WinWrap/WinWrapExamples
        private void Form1_Load(object sender, EventArgs e)
        {
            log_ = new Form3();
            log_.Show();

            try
            {
                conn_ = new Connection("127.0.0.1", 10000);
            }
            catch (Exception ex)
            {
                MessageBox.Show("Can't connect to remote port.\r\n\r\n" + ex.ToString());
                Close();
                return;
            }

            basicIdeCtl1.Synchronized = true;
            timer1.Enabled = true;
        }
コード例 #2
0
ファイル: Program.cs プロジェクト: ScottWeinstein/Linq2KdbQ
        public static void Main(string[] args)
        {
            using (new KLinqTests.KdbProcess(qPortNum,false))
            {
                using (IConnection connection = new Connection("localhost", qPortNum))
                {
                    connection.Run(@"\l sp.q");

                    var tkc = new TestKdbContext(connection);
                    string city = "london";
                    var qry = tkc.sRecord.Where(supRow => supRow.city == city);
                    Console.WriteLine("{0}\n", qry);

                    Console.WriteLine("Query results");
                    Console.WriteLine("{0}\t{1}\t{2}\t{3}", "name", "city", "s", "status");
                    foreach (var item in qry.ToList())
                    {
                        Console.WriteLine("{0}\t{1}\t{2}\t{3}", item.name, item.city, item.s, item.status);
                    }
                    Console.WriteLine("\n");

                    qry = tkc.sRecord.Where(supRow => supRow.status == 10);
                    Console.WriteLine("Query:tkc.sRecord.Where(supRow => supRow.status == 10)");
                    Console.WriteLine("{0}\t{1}\t{2}\t{3}", "name", "city", "s", "status");
                    foreach (var item in qry.ToList())
                    {
                        Console.WriteLine("{0}\t{1}\t{2}\t{3}", item.name, item.city, item.s, item.status);
                    }
                    Console.WriteLine("\n");

                    var qry2 = from row in tkc.sRecord
                               where row.status == 20 && row.city == "london"
                               select row.name;
                    Console.WriteLine(@"from row in tkc.sRecord where row.status == 20 && row.city == ""london"" select row.name;");
                    Console.WriteLine(String.Join(",",qry2.ToArray()));
                    var s = Console.ReadKey();
                }
            }
        }