I am converting a bunch of asp pages to asp.net. These pages all connect to a database with a shared function in a vbs file I can do it in classic asp by using <!#INCLUDE filename.vbs-->.
How do I share a function between apsx pages in asp.net?
I wrote the following function that returns a DataSet but I get the following Compiler Error:
The compiler failed with error code 2000
.vb file:
Imports System.Data
Imports System.Data.OLEDB
Namespace GlobalFunctions
Class Global
Public Shared Function GetDataSet() as DataSet
Dim DBConn as OleDbConnection
Dim DBCommand As OleDbDataAdapter
Dim DSPageData as new System.Data.DataSet
DBConn = New OleDbConnection "PROVIDER=Microsoft.Jet.OLEDB.4.0;DATA SOURCE=path to DB;Jet OLEDBatabase Password=password;")
DBCommand = New OleDbDataAdapter ("sqlDBConn)
DBCommand.Fill(DSPageData, "Exceptions")
GetDataSet = DSPageData
End function
End Class
End Namespace
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.