I have 2 subroutine in my dataAccess class that basically populates dropdownbox and listbox.
I'm trying to cut this down to one instead of two, is it possible please?
Public Overloads Sub FillDBControl(ByVal lb As ListBox, ByVal sql As String, ByVal value As String, ByVal text As String)
lb.DataSource = ReturnDR(sql)
lb.DataTextField = text
lb.DataValueField = value
And the other
Public Overloads Sub FillDBControl(ByVal ddl As DropDownList, ByVal sql As String, ByVal value As String, ByVal text As String)
ddl.DataSource = ReturnDR(sql)
ddl.DataTextField = text
ddl.DataValueField = value
What i'd like is to have just the one like so..
Public Sub FillDBControl(c as control, sql as string .....)
Using ASP.Net 2.0, VB