show GridView with click button

Home / Uncategorized / show GridView with click button

Question:
I m beginner about asp.net .I have oracle database that I want when I clicked to button show result (form of result is datatable)of search in Gridview. before i was hidden. thanks for help


Answer:
protected void Button1_Click(object sender, EventArgs e)
{
GridView1.DataSource = info(id);
GridView1.DataBind();
}
or
protected void Button1_Click(object sender, EventArgs e)
{
DataTable dt = new DataTable();
dt = info(id);
GridView1.DataSource = dt;
GridView1.DataBind();
}
info method directly returns DataTable, then values are assigned to GridView.
Read more

Leave a Reply

Your email address will not be published. Required fields are marked *