I'm trying to use the global.asax in my new web aplication proyect
using the Application start to store my connection string
GLOBAL.ASAX.vb
Sub Application_Sta rt(ByVal sender As Object, ByVal e As EventArgs)
Dim objConnection As OleDbConnection
Dim daContent As OleDbDataAdapte r
Dim objDataReader As OleDbDataReader
Dim objCommand As New OleDbCommand
Dim mySqlStatment As String = "Select * FROM materia1Links_c l"
objConnection = New OleDbConnection ("Provider=Micr osoft.Jet.OLEDB .4.0; Data
Source=D:\works \WEBS\edusalon\ dbcontainer\dat db.mdb")
End Sub
The problem is, when I try to use this code in the
Webform1.aspx
Code inside of the HTML
<Script language="vb" runat ="server"
DIM mySqlStatment AS STRING = "Select * FROM materia1Links_c l"
try
objConnection.o pen()
objDataReader = objCommand.Exec uteReader()
DO WHILE objDataReader.R ead()= true
Response.write( objDataReader(" mycolum"))
loop
objDataReader.c lose()
objConnection.c lose()
Catch e as EXCEPTION
end try
end Sub
</script>
The error generated are my variables ar not declare objConnection,
objDataReader ... I m not really sure what I'm doing wrong
I thoght that when I place my variables in the globlas asax thay going to be
available each time I open the web application
did somebody know how is the correct way to use the Application_Sta rt with
my connection string in it and how my others form
can use it. thanks