Пример #1
0
        private void button4_Click(object sender, EventArgs e)
        {
            byte[] photo       = GetPhoto(path);
            int    renk_sayisi = cs.get_color_number();
            IntPtr ptr         = cs.get_shapes();

            int[] array = new int[10];
            Marshal.Copy(ptr, array, 0, 10);
            string sekil_sayisi = "";
            int    i            = 0;

            while (array[i] != 0)
            {
                sekil_sayisi = sekil_sayisi + array[i].ToString() + ",";
                i++;
            }
            Console.WriteLine(sekil_sayisi);
            string time = DateTime.Now.ToString("h:mm:ss tt");


            LinQDataContext lq    = new LinQDataContext();
            MIA             table = new MIA();

            table.Image_Name   = img_name;
            table.Sekil_Sayisi = sekil_sayisi;
            table.Renk_Sayisi  = renk_sayisi;
            table.Tarih        = time;
            table.Resim        = photo;
            lq.MIAs.InsertOnSubmit(table);
            lq.SubmitChanges();
            MessageBox.Show("Kayıt işlemi Başarılı");
            Console.WriteLine(time);
        }
Пример #2
0
        private void button1_Click(object sender, EventArgs e)
        {
            LinQDataContext lq = new LinQDataContext();

            dataGridView1.DataSource = from data_table in lq.MIAs
                                       select new
            {
                data_table.ID,
                data_table.Image_Name,
                data_table.Sekil_Sayisi,
                data_table.Renk_Sayisi,
                data_table.Resim,
                data_table.Tarih
            };
        }