Trying to re-visit this post and shed some light on why I can only refresh a "non-dynamic" GridView?
Perhaps I am making up the termanology "non-dynamic", but it will help for understanding my issue.
I already have a GridView that is "non-dynamic", or not actively linked to DataSourceID.
Meaning I cannot edit, delete or create from within a GridView like this.
Being able to refresh this GridView, which acts like a display of contents, is easy. I use this code:
Private Sub MyFunc(ByVal sender As Object, ByVal e As System.EventArgs)
Dim mySqlString As New StringBuilder()
mySqlString.Append("SELECT * ")
mySqlString.Append("FROM {databaseOwner}{objectQualifier}ModuleName ")
mySqlString.Append("ORDER BY ClientName ASC")
Me.GridView2.DataSource = CType(DataProvider.Instance().ExecuteSQL(mySqlString.ToString(), Nothing), IDataReader)
Me.GridView2.DataBind()
End Sub
Yet, when I try to use this same method on the "Dynamic GridView", which allows for creating, editing & deleting data I get errors.
This GridView is linked to DataSourceID, therefore when running this same method and having linked to DataSourceID throws this error:
|
A critical error has occurred.
Both DataSource and DataSourceID are defined on 'GridView1'. Remove one definition. |
Although I cannot run the "Dynamic GridView" without DataSourceID.
What code will refresh contents of "Dynamic GridView" within page_load, so that data in sql already appears and can be edited?
Feedback appreciated,
-machina12