I am trying to create a function that passes a Dataset. I know the code
works because if I cut and paste it on my file in code behind it works
fine.
The actual task is to create the Dataset from a SQLDataAdapter within a
function. Then I want to call the function to fill a dropdown list on
my .aspx page.
Here is the current code that I am using in the function. I am unaware
of what I should be using on the .aspx page.
Any and all help is appreciated.
Public Function ShowRootFolders(ByVal ClientID As String) As DataSet
Dim Connect As String
Dim CompanyDataSet As DataSet
Dim GetCompanys As SqlClient.SqlDataAdapter
Connect =
ConfigurationSettings.AppSettings("THE_Connection")
Dim Connection As New SqlClient.SqlConnection(Connect)
Connection.Open()
GetCompanys = New SqlClient.SqlDataAdapter("Select * from
rootfolders where clientID = '" + ClientID + "'", Connection)
CompanyDataSet = New DataSet
GetCompanys.Fill(CompanyDataSet, "AllTables")
DMConnection.Close()
Return ShowRootFolders