1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42
|
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace WindowsFormsApplication6
{
public partial class Interface : Form
{
données d = new données();
public Interface()
{
InitializeComponent();
}
private void Interface_Load(object sender, EventArgs e)
{
d.remplirgrid9("Bureau", "Direction", "Ch6", "Ch4", DgvBureaux); // c'est des fonctions qui existe dans une autre classe
d.remplirgrid10("Bureau", "Direction", "Ch6", "Ch4", ddg); //
d.remplirgrid11("Bureau", "Direction", "Ch6", "Ch4", ddgg); //
int n = ddg.Rows.Count;
for (int i = 0; i < n - 1; i++)
{
d.connecter();
d.cmd.Connection = d.con;
string la = ddg.Rows[i].Cells["Nom"].Value.ToString();
d.cmd.CommandText = " SELECT IDB from Bureau where Nom= '" + la + "' ";
int cc = int.Parse(d.cmd.ExecuteScalar().ToString());
d.cmd.CommandText = "INSERT INTO Ch4 VALUES (0,'" + cc + "')";
d.cmd.ExecuteNonQuery();
} |
Partager