I have a usercontrol with a repeater. Initially, in the page load, I had code that grabbed data from a database and attached to a relay. Now I want to use this functionality outside of user control, so that I have more than one on the page and bind to different data.
Now my code is:
Imports System.ComponentModel Public Class UpdateList Inherits System.Web.UI.UserControl Private m_dataSource As Object <TypeConverter("System.Windows.Forms.Design.DataSourceConverter, System.Design")> _ <Category("Data")> _ <DefaultValue(Nothing)> _ Public Property DataSource() As Object Get Return Me.m_dataSource End Get Set(value As Object) If Me.m_dataSource <> value Then m_dataSource = value tryDataBinding() End If End Set End Property Public ReadOnly Property UpdateCount As Integer Get Return m_UpdateCount End Get End Property Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load End Sub Protected Sub tryDataBinding() rep_Updates.DataSource = Me.m_dataSource rep_Updates.DataBind() End Sub End Class
I get a wavy line in <DefaultValue(Nothing)> and get an error message:
An overload error is not possible because the "New" is not the most accessible for these arguments:
'Public Sub New (meaning As Boolean)': not the most specific.
'Public Sub New (value as byte)': not the most specific.
'Public Sub New (meaning As Char)': Not the most accurate.
What does it mean? Thanks
UPDATE
The fix is ββto change the property declaration for the data source to ...
Private m_dataSource As Object Public Property DataSource() As Object Get Return Me.m_dataSource End Get Set(value As Object) m_dataSource = value tryDataBinding() End Set End Property
source share