N
news.microsoft.com
Hello All,
im am new to ASP.NET, so bare with me.
i have an application that i am building in stages.
stage1 user picks data required
stage2 file is written to a virutal directory
Stage3 the file is then saved by the user to their hard disk
i am currently in stage 3, i am using a httpresponse.redirect method, this
is throwing up the following error and i don't know how to fix it, can some
body please point me in the right direction? the filename that is am passing
it is as follows data.csv (a better naming convention will be in place when
i can get the file to be downloaded by the user)
Many thanks
Simon Whale
Server Error in '/datacounts' Application.
--------------------------------------------------------------------------------
Object reference not set to an instance of an object.
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 145: sw = Nothing
Line 146:
Line 147: rd.Redirect(file)
Line 148: dr.Close()
Line 149: cn.Close()
Source File: c:\inetpub\wwwroot\datacounts\WebForm1.aspx.vb Line: 147
Stack Trace:
[NullReferenceException: Object reference not set to an instance of an
object.]
datacounts.WebForm1.Button1_Click(Object sender, EventArgs e) in
c:\inetpub\wwwroot\datacounts\WebForm1.aspx.vb:147
System.Web.UI.WebControls.Button.OnClick(EventArgs e)
System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String
eventArgument)
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler
sourceControl, String eventArgument)
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData)
System.Web.UI.Page.ProcessRequestMain()
im am new to ASP.NET, so bare with me.
i have an application that i am building in stages.
stage1 user picks data required
stage2 file is written to a virutal directory
Stage3 the file is then saved by the user to their hard disk
i am currently in stage 3, i am using a httpresponse.redirect method, this
is throwing up the following error and i don't know how to fix it, can some
body please point me in the right direction? the filename that is am passing
it is as follows data.csv (a better naming convention will be in place when
i can get the file to be downloaded by the user)
Many thanks
Simon Whale
Server Error in '/datacounts' Application.
--------------------------------------------------------------------------------
Object reference not set to an instance of an object.
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 145: sw = Nothing
Line 146:
Line 147: rd.Redirect(file)
Line 148: dr.Close()
Line 149: cn.Close()
Source File: c:\inetpub\wwwroot\datacounts\WebForm1.aspx.vb Line: 147
Stack Trace:
[NullReferenceException: Object reference not set to an instance of an
object.]
datacounts.WebForm1.Button1_Click(Object sender, EventArgs e) in
c:\inetpub\wwwroot\datacounts\WebForm1.aspx.vb:147
System.Web.UI.WebControls.Button.OnClick(EventArgs e)
System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String
eventArgument)
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler
sourceControl, String eventArgument)
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData)
System.Web.UI.Page.ProcessRequestMain()