C
Chris
Hi,
I want to put the namespaces and the data connection into global.asax like
this:
<%@ import namespace="System.Data"%>
<%@ import namespace="System.Data.OleDb"%>
<script runat="server">
Sub Application_Start(ByVal sender As Object, ByVal e As EventArgs)
Dim oConnection As System.Data.OleDb.OleDbConnection
oConnection = New System.Data.OleDb.OleDbConnection()
Dim comd As System.Data.OleDb.OleDbCommand
Dim dtreader As System.Data.OleDb.OleDbDataReader
Dim sConnectionString As String
sConnectionString = "Provider = Microsoft.Jet.OLEDB.4.0; Data Source
= c:\mydb.mdb"
oConnection.ConnectionString = sConnectionString
oConnection.Open()
End Sub
</script>
But how to link the global.asax file to the file (fetch.aspx) which must
fetch the data?
I did this in fetch.aspx file which generates an error "Name 'comd' is not
declared"
comd = New System.Data.OleDb.OleDbCommand("select count(*) from pc",
oConnection)
Thanks for helping.
Chris
I want to put the namespaces and the data connection into global.asax like
this:
<%@ import namespace="System.Data"%>
<%@ import namespace="System.Data.OleDb"%>
<script runat="server">
Sub Application_Start(ByVal sender As Object, ByVal e As EventArgs)
Dim oConnection As System.Data.OleDb.OleDbConnection
oConnection = New System.Data.OleDb.OleDbConnection()
Dim comd As System.Data.OleDb.OleDbCommand
Dim dtreader As System.Data.OleDb.OleDbDataReader
Dim sConnectionString As String
sConnectionString = "Provider = Microsoft.Jet.OLEDB.4.0; Data Source
= c:\mydb.mdb"
oConnection.ConnectionString = sConnectionString
oConnection.Open()
End Sub
</script>
But how to link the global.asax file to the file (fetch.aspx) which must
fetch the data?
I did this in fetch.aspx file which generates an error "Name 'comd' is not
declared"
comd = New System.Data.OleDb.OleDbCommand("select count(*) from pc",
oConnection)
Thanks for helping.
Chris