M
mravichandran
Dear Readers,
I am trying to take image files and store them in SQL server. as a 1st
step, I am trying to read them from a directory on the network.
in the declaration section (below the class declaration) I have:
protected System.Web.UI.HtmlControls.HtmlInputFile ImageFile;
inside the function button_click: I have
ImageFile = new HtmlInputFile();
string strFileName = "";
strFileName= ImageFile.PostedFile.FileName;
on exectuing the "strFileName = Image..." statement, it gives the
following error:
**********************************
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 80:
Line 81: string strFileName = "";
Line 82: strFileName= ImageFile.PostedFile.FileName;
Line 83: string strFilePath = Path.GetFileName(strFileName);
*******************************
any help will be appreciated.
thanks and regards
Ravi.
I am trying to take image files and store them in SQL server. as a 1st
step, I am trying to read them from a directory on the network.
in the declaration section (below the class declaration) I have:
protected System.Web.UI.HtmlControls.HtmlInputFile ImageFile;
inside the function button_click: I have
ImageFile = new HtmlInputFile();
string strFileName = "";
strFileName= ImageFile.PostedFile.FileName;
on exectuing the "strFileName = Image..." statement, it gives the
following error:
**********************************
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 80:
Line 81: string strFileName = "";
Line 82: strFileName= ImageFile.PostedFile.FileName;
Line 83: string strFilePath = Path.GetFileName(strFileName);
*******************************
any help will be appreciated.
thanks and regards
Ravi.