I want to get information from a database about a file. I have an asp.net app that uses a strongly-typed DataSet created by Visual Studio 2005 (vb.net). This creates a TableAdapter and DataTable. I would like to pass the TableAdapter and DataTable to a function and then return the TableAdapter and DataTable. Perhaps I need to pass the whole dataset. In any case, I can't find how to pass these back and forth. Can you help?
I pick the TableAdapter and DataTable as shown below. This works fine, except I can't see how I would pass this back and forth to a function. Right now it's in my main presentation web page, and I want it to be in a separate class, like a data access layer.
If strLocation = "k" Then
If URL.IndexOf("company.com") <> -1
DocAdapter = New DocumentsDEVTableAdapters.DocumentsDEV_TableAdapter
CurrentDT = New DocumentsDEV.DocumentsDEV_DataTableDataTable
Else 'For Production and localhost:
DocAdapter = New DocumentsPRODTableAdapters.DocumentsPROD_TableAdapter
CurrentDT = New DocumentsPROD.DocumentsPROD_DataTableDataTable
ElseIf strLocation = "h"
If GlobalVars.ReferringURL.IndexOf("company2.com") <> -1
DocAdapter = New companyExtensionsDEVTableAdapters.companyExtensionsDEV_TableAdapter
CurrentDT = New companyExtensionsDEV.companyExtensionsDEV_DataTableDataTable
Else 'For Prod and localhost:
DocAdapter = New companyExtensionsProdTableAdapters.companyExtensionsPROD_TableAdapter
CurrentDT = New companyExtensionsProd.companyExtensionsPROD_DataTableDataTable
CurrentDT = DocAdapter.GetFileName(strDocumentNumber)