Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Share Connection string between aspx pages

Status
Not open for further replies.

EricBonsu

MIS
Jul 19, 2006
17
US
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 OLEDB:Database Password=password;")
DBCommand = New OleDbDataAdapter ("sqlDBConn)
DBCommand.Fill(DSPageData, "Exceptions")
GetDataSet = DSPageData
End function
End Class
End Namespace
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top