Michael,
As soon as I imported code, I noticed that the DataProvider & iDataReader had error lines, as well as random code below.Seemed to have issues with a search feature that also uses DataProvider & iDataReader for collection.Also noticed I was using page_load, and maybe both page_load and page_init adds to errors.
Can I run multiple DataProvider Collections in one module? (i hope)
What do you think looks like the problem?
Here is the error it throws:
|
A critical error has occurred.
Both DataSource and DataSourceID are defined on 'ListBox1'. Remove one definition. |
This is the imported code:
Private Sub ShowData(ByVal SearchString As String)
Dim mySqlString As New StringBuilder()
mySqlString.Append("SELECT ClientName")
mySqlString.Append("FROM {databaseOwner}{objectQualifier} ModuleName ")
mySqlString.Append("ORDER BY ClientName ASC")
Dim myParam As SqlParameter = New SqlParameter("@SearchString", SqlDbType.VarChar, 150)
myParam.Value = SearchString
Me.GridView2.DataSource = CType(DataProvider.Instance().ExecuteSQL(mySqlString.ToString(), myParam), IDataReader)
Me.GridView2.DataBind()
The code below that uses a DataProvider & iDataReader is:
Protected Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.LoadShowData(txtSearch.Text)
Dim mySqlString As New StringBuilder()
mySqlString.Append("SELECT ClientName ")
mySqlString.Append("FROM {databaseOwner}{objectQualifier}iSTORE ")
mySqlString.Append("ORDER BY ClientName")
Me.ListBox1.DataSource = CType(DataProvider.Instance().ExecuteSQL(mySqlString.ToString(), Nothing), IDataReader)
Me.ListBox1.DataBind()
End Sub