Académique Documents
Professionnel Documents
Culture Documents
SqlConnection Cnx;
SqlDataAdapter DA;
SqlCommandBuilder CB;
int iPos=-1;
string sConnexion = "Data Source=.;Initial Catalog=ADO_DB;Integrated Security=True";
string sQuery;
public Form1()
{
InitializeComponent();
}
DA.Fill(DS_Livres, "Livres");
Fill_ComboBox();
}
}
catch (Exception Ex)
{
MessageBox.Show(Ex.Message, "Attention", MessageBoxButtons.OK, MessageBoxIcon.Warning);
}
finally
{
Fill_ComboBox();
button1.PerformClick();
}
}
frm.dataGridView1.DataSource = DS_Livres.Tables["Livres"];
frm.ShowDialog();
}
=======================================================================================================
=======================================================================================================
=======================================================================================================
=======================================================================================================
public Form4()
{
InitializeComponent();
}
DA.Fill(DS_Adherent, "Adherent");
Navigate();
}
dataGridView1.DataSource = myBindingSource;
textBox1.DataBindings.Add("Text", myBindingSource, "CodeA");
textBox2.DataBindings.Add("Text", myBindingSource, "NomA");
textBox3.DataBindings.Add("Text", myBindingSource, "adresse");
dateTimePicker1.DataBindings.Add("Text", myBindingSource, "DateInscription");
}
private void button1_Click(object sender, EventArgs e)
{
if (button1.Text == "Nouveau")
{
button1.Text = "Ajouter";
myBindingSource.AddNew();
}
else if (button1.Text == "Ajouter")
{
myBindingSource.EndEdit();
dataGridView1.Refresh();
button1.Text = "Nouveau";
}
}
private void button2_Click(object sender, EventArgs e)
{
myBindingSource.EndEdit();
}
=======================================================================================================
=======================================================================================================
=======================================================================================================
=======================================================================================================
DataSet Ds = new DataSet();
SqlConnection Cnx = new SqlConnection();
SqlDataAdapter DA_Livre = new SqlDataAdapter();
SqlDataAdapter DA_Theme = new SqlDataAdapter();
DataRow[] drLivre;
DataRow[] drTheme;
public Form3()
{
InitializeComponent();
}
DA_Livre.Fill(Ds, "Livres");
DA_Theme.Fill(Ds, "Themes");
Ds.Relations.Add(Rel);
dataGridView1.DataSource = tab;
dataGridView1.ClearSelection();
}