Ejemplo n.º 1
0
        private void button2_Click(object sender, EventArgs e)
        {
            EditTeam2 editTeam2 = new EditTeam2();

            editTeam2.ShowDialog();

            string sql = "SELECT     dbo.Team.id, dbo.Team.name AS Название, dbo.Country.name AS Страна, dbo.Team.games AS Игр, dbo.Team.victori AS Побед, dbo.Team.loss AS Проигрышей, dbo.Team.country " +
                         " FROM dbo.Team INNER JOIN " +
                         " dbo.Country ON dbo.Team.country = dbo.Country.id ";

            adapter = new OleDbDataAdapter(sql, con);
            ds      = new DataTable();
            adapter.Fill(ds);
            dataGridView1.Columns.Clear();
            dataGridView1.DataSource         = ds;
            dataGridView1.Columns[0].Visible = false;
            dataGridView1.Columns[6].Visible = false;
        }
Ejemplo n.º 2
0
        private void button1_Click(object sender, EventArgs e)
        {
            int       tmp       = dataGridView1.CurrentRow.Index;
            int       nom       = Convert.ToInt32(dataGridView1[0, tmp].Value);
            EditTeam2 editTeam2 = new EditTeam2(dataGridView1[1, tmp].Value.ToString(),
                                                dataGridView1[2, tmp].Value.ToString(), dataGridView1[3, tmp].Value.ToString(),
                                                dataGridView1[4, tmp].Value.ToString(), dataGridView1[5, tmp].Value.ToString(),
                                                Convert.ToInt32(dataGridView1[6, tmp].Value), nom
                                                );

            editTeam2.ShowDialog();

            string sql = "SELECT     dbo.Team.id, dbo.Team.name AS Название, dbo.Country.name AS Страна, dbo.Team.games AS Игр, dbo.Team.victori AS Побед, dbo.Team.loss AS Проигрышей, dbo.Team.country " +
                         " FROM dbo.Team INNER JOIN " +
                         " dbo.Country ON dbo.Team.country = dbo.Country.id ";

            adapter = new OleDbDataAdapter(sql, con);
            ds      = new DataTable();
            adapter.Fill(ds);
            dataGridView1.Columns.Clear();
            dataGridView1.DataSource         = ds;
            dataGridView1.Columns[0].Visible = false;
            dataGridView1.Columns[6].Visible = false;
        }