T
tomcarr1
I have an ASP.net webform with a datagrid on it.
I can change the SQL select statement for the grid in code by putting
a statement like this in the first line of Page_Load
OleDbDataAdapter1.SelectCommand.CommandText = "SELECT * from table
where ... "
The rest of the code in Sub Page_Load is
OleDbDataAdapter1.Fill(DsCategories1)
If Not IsPostBack Then
DataGrid1.DataBind()
End If
This works fine on the initial load of the the webform. If I want to
change the SQL command to load different data into the grid after the
form is loaded, and do that with a cmdButton, what code to I put under
the cmdButton to reload the webform or grid with the new sql select?
I can change the SQL select statement for the grid in code by putting
a statement like this in the first line of Page_Load
OleDbDataAdapter1.SelectCommand.CommandText = "SELECT * from table
where ... "
The rest of the code in Sub Page_Load is
OleDbDataAdapter1.Fill(DsCategories1)
If Not IsPostBack Then
DataGrid1.DataBind()
End If
This works fine on the initial load of the the webform. If I want to
change the SQL command to load different data into the grid after the
form is loaded, and do that with a cmdButton, what code to I put under
the cmdButton to reload the webform or grid with the new sql select?