Example #1
0
        private void button4_Click(object sender, EventArgs e)
        {
            DataClasses1DataContext dbcon = new DataClasses1DataContext(@"Data Source=(LocalDB)\v11.0;AttachDbFilename=" + @"C:\Users\user\documents\visual studio 2013\Projects\DemoProjectApplication2\DemoProjectApplication2\Database1.mdf" + @";Integrated Security=True");
            int       genre_id            = Int32.Parse(comboBox1.SelectedValue.ToString());
            Category1 ct = dbcon.Category1s.SingleOrDefault(x => x.Id == genre_id);

            dataGridView1.Rows.Clear();
            foreach (Games_table ap in ct.Games_tables)
            {
                dataGridView1.ColumnCount      = 12;
                dataGridView1.Columns[0].Name  = "Id";
                dataGridView1.Columns[1].Name  = "name";
                dataGridView1.Columns[2].Name  = "os";
                dataGridView1.Columns[3].Name  = "processor";
                dataGridView1.Columns[4].Name  = "ram";
                dataGridView1.Columns[5].Name  = "gpu";
                dataGridView1.Columns[6].Name  = "directx";
                dataGridView1.Columns[7].Name  = "hdd";
                dataGridView1.Columns[8].Name  = "release";
                dataGridView1.Columns[9].Name  = "genre_type";
                dataGridView1.Columns[10].Name = "genre_id";
                dataGridView1.Columns[11].Name = "image";
                dataGridView1.Rows.Add(ap.Id, ap.name, ap.os, ap.processor, ap.ram, ap.gpu, ap.directx, ap.hdd, ap.release, ap.genre_type, ap.genre_id, ap.image);
            }
        }
 partial void DeleteCategory1(Category1 instance);
 partial void UpdateCategory1(Category1 instance);
 partial void InsertCategory1(Category1 instance);