fill dropdownlist in my ascx?
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
and in my vb i tried:
Dim mycontrol As New myascxcontrol
How can I do it?
By Q*bert in forum Database
Last Post: 02-14-2003, 04:05 PM
By Jeff Tucker in forum ASP.NET
Last Post: 09-13-2001, 04:03 PM
By David Livingston in forum ASP.NET
Last Post: 01-26-2001, 04:17 PM
By Gill in forum VB Classic
Last Post: 11-15-2000, 05:27 PM
By stephane in forum ASP.NET
Last Post: 08-24-2000, 05:06 PM
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL