Hi
Please be sure about using
System.Data
namespace and the after that keep in your mind you should call
DataBind()
method after data source binding in asp.net so I think you forget it:
protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e)
{
OleDbConnection con = new OleDbConnection("Data Source=orcl;Persist Security Info=True;User ID=eq;Password=*******;Unicode=True");
OleDbDataAdapter dataAdapter = new OleDbDataAdapter(String.Format("select * from teacher where idteacher={0} ", idteacher), con);
DataTable table = new DataTable();
dataAdapter.Fill(table);
GridView1.DataSource = table;
GridView1.DataBind();
}
At the finally I prefer to you review follow of link:
Five different overloads of the DataAdapter.Fill() method[
^]
Best Regards.