I have a storedProcedure that populates a dataset, this dataset is then used for a dataSource for a third party grid control. This all works fine, however I am having real trouble in updating the dataSet with the most recent data from my database.
Below is the code that I am using to populate the dataSet:
I am not sure how to update the dataSet with new data so that my grid control displays the most recent data. Could someone show me the code to do this?
Thanks in advance
Simon
Below is the code that I am using to populate the dataSet:
VB.NET:
Dim myDA As New OleDb.OleDbDataAdapter("spQryParentComments", myDB.myConn)
myDA.SelectCommand.CommandType = CommandType.StoredProcedure
myDA.SelectCommand.Parameters.Add(New OleDb.OleDbParameter("@projName", OleDb.OleDbType.VarChar)).Value = "Ticodi"
myDA.SelectCommand.Parameters.Add(New OleDb.OleDbParameter("@userID", OleDb.OleDbType.VarChar)).Value = "2"
Dim dataParentTable As DataTable = New DataTable("Parent")
myDA.Fill(dataParentTable)
Dim myChildDA As New OleDb.OleDbDataAdapter("spQryChildComments", myDB.myConn)
myChildDA.SelectCommand.CommandType = CommandType.StoredProcedure
myChildDA.SelectCommand.Parameters.Add(New OleDb.OleDbParameter("@projName", OleDb.OleDbType.VarChar)).Value = "Ticodi"
myChildDA.SelectCommand.Parameters.Add(New OleDb.OleDbParameter("@userID", OleDb.OleDbType.VarChar)).Value = "2"
Dim dataChildTable As DataTable = New DataTable("Child")
myChildDA.Fill(dataChildTable)
Me.ReviewInSightDataSet.Tables.Add(dataParentTable)
Me.ReviewInSightDataSet.Tables.Add(dataChildTable)
Dim keyColumn As DataColumn = Me.ReviewInSightDataSet.Tables("Parent").Columns("commID")
Dim foreignKey As DataColumn = Me.ReviewInSightDataSet.Tables("Child").Columns("commID")
Me.ReviewInSightDataSet.Relations.Add("Comment Revision", keyColumn, foreignKey)
Me.lstComments.DataSource = Me.ReviewInSightDataSet.Tables("Parent")
I am not sure how to update the dataSet with new data so that my grid control displays the most recent data. Could someone show me the code to do this?
Thanks in advance
Simon