Click here to Skip to main content
15,905,427 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
The error comes when i complie the project

error is the name 'xx' does not exist in the current context

code in aspx page


XML
<asp:Button ID="btndwn" runat="server" Text="Download Excel" OnClick="btndwn_Click" />
   <asp:FileUpload ID="fleupld" runat="server" />
   <asp:Button ID="btnupld" runat="server" Text="Upload Excel" OnClick="btnupld_Click" />


code in aspx.cs
C#
strDirectoryName =  fleupld.PostedFile.FileName;
        strFileName = fleupld.FileName;
        strFullDirectoryName = dirInfo.FullName + "\\" + strFileName;
        fleupld.PostedFile.SaveAs(strFullDirectoryName);
        sConnectionString = @"Provider=Microsoft.Jet.OLEDB.4.0;Data Source =" + dirInfo.FullName + " ;Extended Properties=\"Text;HDR=YES;FMT=Delimited\"";
        objConn = new OleDbConnection(sConnectionString);
        objConn.Open();
Posted
Updated 21-Nov-13 18:07pm
v2
Comments
♥…ЯҠ…♥ 22-Nov-13 0:33am    
Do you get the name 'xx' does not exist in the current context, but it looks like there is no possibility for the error in the code snippet you have provided....

 
Share this answer
 
Comments
alex giulio 21-Nov-13 6:24am    
hi, prasadvjay, please tell it clearly. if we know, we'll help you
Define the variable.
You might need to start with a book to learn some of the basics of the language.
 
Share this answer
 
Hi Prasad,

Assumption answer, since there is no clue what is your error about.
I think you are missing the class reference here.
Make you class reference to your project and everything will work for you.

If you need confirm solution then you need to update your question with code and anything that can make us to answer.

Hope this helps you a bit.

Regards,
RK
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900