Hi Folks,
I develop a .NET web application, it run just find on my old machine. Now I copy/move it to other machine/server.
Both machine have have framework version v1.1.4322, and of course both have Visual Studio .NET.
But when I run the application on the new machine, I get this error:
=========================================================
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.
Source Error:
Line 224: dr.Close()
Line 225: End If
Line 226: cnn.Close()
Line 227: cnn = Nothing
Line 228: cmd.Dispose()
Source File: c:\inetpub\ Line: 226
Stack Trace:
[NullReferenceException: Object reference not set to an instance of an object.]
EEOC.EEO1_Main.load_year() in c:\inetpub\ EEOC.EEO1_Main.Page_Load(Object sender, EventArgs e) in c:\inetpub\ System.Web.UI.Control.OnLoad(EventArgs e) +67
System.Web.UI.Control.LoadRecursive() +35
System.Web.UI.Page.ProcessRequestMain() +731
===========================================
The code below is at that section.
Private Sub load_year()
Dim cnn As OracleConnection
Dim cmd As OracleCommand
Dim dr As OracleDataReader
Dim SQL As String = "select * from table(cast(emp_inds_query.get_years() as emp_year_list_tab))"
Try
cnn = New OracleConnection(ConfigurationSettings.AppSettings("strConn"))
cnn.Open()
cmd = New OracleCommand(SQL, cnn)
dr = cmd.ExecuteReader()
ddl_year.DataSource = dr
ddl_year.DataTextField = "YEAR"
ddl_year.DataValueField = "YEAR"
ddl_year.DataBind()
Catch ex As Exception
Label1.Text = ex.ToString
Finally
If Not dr Is Nothing Then
dr.Close()
End If
cnn.Close()
cnn = Nothing
cmd.Dispose()
End Try
End Sub
=====================
Please help....
Thanks....
Mike
I develop a .NET web application, it run just find on my old machine. Now I copy/move it to other machine/server.
Both machine have have framework version v1.1.4322, and of course both have Visual Studio .NET.
But when I run the application on the new machine, I get this error:
=========================================================
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.
Source Error:
Line 224: dr.Close()
Line 225: End If
Line 226: cnn.Close()
Line 227: cnn = Nothing
Line 228: cmd.Dispose()
Source File: c:\inetpub\ Line: 226
Stack Trace:
[NullReferenceException: Object reference not set to an instance of an object.]
EEOC.EEO1_Main.load_year() in c:\inetpub\ EEOC.EEO1_Main.Page_Load(Object sender, EventArgs e) in c:\inetpub\ System.Web.UI.Control.OnLoad(EventArgs e) +67
System.Web.UI.Control.LoadRecursive() +35
System.Web.UI.Page.ProcessRequestMain() +731
===========================================
The code below is at that section.
Private Sub load_year()
Dim cnn As OracleConnection
Dim cmd As OracleCommand
Dim dr As OracleDataReader
Dim SQL As String = "select * from table(cast(emp_inds_query.get_years() as emp_year_list_tab))"
Try
cnn = New OracleConnection(ConfigurationSettings.AppSettings("strConn"))
cnn.Open()
cmd = New OracleCommand(SQL, cnn)
dr = cmd.ExecuteReader()
ddl_year.DataSource = dr
ddl_year.DataTextField = "YEAR"
ddl_year.DataValueField = "YEAR"
ddl_year.DataBind()
Catch ex As Exception
Label1.Text = ex.ToString
Finally
If Not dr Is Nothing Then
dr.Close()
End If
cnn.Close()
cnn = Nothing
cmd.Dispose()
End Try
End Sub
=====================
Please help....
Thanks....
Mike