ok here is my button_click method:
Dim connectionString As String = "Provider=Microsoft.Jet.OLEDB.4.0; Ole DB
Services=-4; Data Source=" & Server.MapPath("/database/database.mdb")
Dim dbConnection As System.Data.IDbConnection = New
System.Data.OleDb.OleDbConnection(connectionString)
Dim queryString As String = "SELECT
[Special_Cleaning_Tasks].[Special_Task_id],
[Special_Cleaning_Tasks].[Spec" & _
"ial_Task_Description], [Special_Cleaning_Tasks].[Task_Status],
[Special_Cleaning" & _
"_Tasks].[Date_Logged] FROM [Special_Cleaning_Tasks] WHERE
([Special_Cleaning_Tas" & _
"ks].[Task_Status] = ""Completed"")"
Dim dbCommand As System.Data.IDbCommand = New
System.Data.OleDb.OleDbCommand
dbCommand.CommandText = queryString
dbCommand.Connection = dbConnection
Dim dataAdapter As System.Data.IDbDataAdapter = New
System.Data.OleDb.OleDbDataAdapter
dataAdapter.SelectCommand = dbCommand
Dim dsCompleted As System.Data.DataSet = New System.Data.DataSet
dataAdapter.Fill(dsCompleted)
dgSpecial.DataSource = dsCompleted
dgSpecial.DataMember = "Special_Cleaning_Tasks"
dgSpecial.DataBind()
The original data is bound using the page_load:
oledbdataadapter.fill(dsSpecial1)
dgSpecial.databind()
If i click the button will the dg automatically go back to being boudn to
the dataset in the page_load?
cheers
Earl said:
I don't think you could do this with a table bound to the designer.
However, if you used a Dataview, you could set and reset the filter to
mimic this action. Alternatively, you could make a separate trip to the
server for the data, which may or may not be more productive than a single
trip to load everything up and then filter it. Try it both ways.