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
|
private void btnAjouter_Click(object sender, EventArgs e)
{
try
{
if (txtNouvelleTable.Text != "")
{
string nomTable = txtNouvelleTable.Text;
DataSet1 ds = new DataSet1();
DataTable dt = new DataTable();
dt.TableName = nomTable;
ds.Tables.Add(dt);
cboTable.Refresh();
MessageBox.Show("La table à bien été ajouté", "Information", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
else
{
MessageBox.Show("Vous devez saisir un nom de table", "Information", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, "Erreur", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
} |
Partager