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
| public partial class Form1 : Form
{
OdbcConnection con;
OdbcDataAdapter adap;
DataSet Ds;
public Form1()
{
InitializeComponent();
}
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("************************* ", 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);
}
}
private void dataGridView1_CellValueNeeded(object sender, DataGridViewCellValueEventArgs e)
{
e.Value == e.ColumnIndex + "" + e.RowIndex;
} |
Partager