I have a user control in one aspx page.
The page is for a sql query and the user control has one dropdownlist where i can see the columns of the table database where i make the query.
My problem is that the table where i search can change everytime, so i need to pass to the ascx the table where it has to find the columns.
I tried to make a function in my ascx where i fill the dropdown with the table i pass from my vb but it sends me the error "reference not set to an instance of an object" where it reaches the dropdown to fill in my ascx.

I have somethig like this in my ascx

Sub filldr(ByVal table As String)

dsn = ConfigurationSettings.AppSettings("connection")
con = New SqlConnection(dsn)

Dim sSql As String
sSql = "SELECT * FROM [" & table & "]"
Dim dAdap As New SqlDataAdapter(sSql, con)
Dim ds As New DataSet
choosecolumns.Visible = True
For Each dc As DataColumn In ds.Tables(0).Columns
dl1.Items.Add(New ListItem(dc.ColumnName))

End Sub

and in my vb i tried:

Dim mycontrol As New myascxcontrol

How can I do it?