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
| OdbcConnection con;
OdbcDataAdapter adap;
DataSet Ds;
public Form1()
{
InitializeComponent();
}
private void dataGridView1_CellContentClick(object sender, DataGridViewCellEventArgs e)
{
}
private void Form1_Load(object sender, EventArgs e)
{
try
{
con = new OdbcConnection();
con.ConnectionString = @"Dsn=***;Driver={SCO Vision ODBC};uid=***;Pwd=*******";
con.Open();
adap = new OdbcDataAdapter("MA REQUETE ", con);
Ds = new System.Data.DataSet();
adap.Fill(Ds, "ibr");
dataGridView1.DataSource = Ds.Tables[0];
}
catch (Exception ex)
{
MessageBox.Show("ERREUR\n" + ex.Message, "ERREUR", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
} |
Partager