j'ai cette code
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
|
private void button1_Click(object sender, EventArgs e)
{
string strAccessConn = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\\Users\\rezgui mohamed\\Desktop\\agent\\rezgui.mdb";
OleDbConnection aConnection = new OleDbConnection(strAccessConn);
DataTable table = new DataTable("results");
// OleDbCommand aCommand = new OleDbCommand("select * from test", aConnection);
string sql = "select * from test";
aConnection.Open();
OleDbCommand cmd = new OleDbCommand(sql, aConnection);
OleDbDataAdapter adpt = new OleDbDataAdapter(cmd);
adpt.Fill(table);
DataTable table = this.FindName(this.txtToFind.Text);
this.dataGridView1.DataSource = table;
//create the command object and store the sql query
aConnection.Close();
} |
ligne ou ilya lerreur
DataTable table = this.FindName(this.txtToFind.Text);
mai je n'arrive pas a afficher la datatable dans une datagridview
aider moi de corriger le code
merci d'avance
Partager