编译项目时的错误 [英] error of when complie the project

查看:88
本文介绍了编译项目时的错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我编译项目时出现错误



错误是当前上下文中不存在名称'xx'


$ p $ b aspx页面代码





 <   asp:按钮    ID   =  btndwn    runat   = 服务器   文字  = 下载Excel    OnClick   =  btndwn_Click    /  >  
< < span class =code-leadattribute> asp:FileUpload ID = fleupld runat = server / >
< asp:按钮 ID < span class =code-keyword> = btnupld runat = server 文字 = 上传Excel OnClick = btnupld_Click / >





aspx.cs中的代码

 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 + ;扩展属性= \Text; HDR = YES; FMT = Delimited\ ;
objConn = new OleDbConnection(sConnectionString);
objConn.Open();

解决方案

让我谷歌为你 [ ^ ]。


定义变量。

您可能需要从一本书开始学习该语言的一些基础知识。


Hi Prasad,



假设答案,因为不知道你的错误是什么。

我认为你在这里缺少课程参考。

让你上课引用你的项目,一切都适合你。



如果你需要确认解决方案,那么你需要用代码和任何可以让我们回答的问题来更新你的问题。



希望这对你有所帮助。



问候,

RK

The error comes when i complie the project

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

code in aspx page


<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

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();

解决方案

Let Me Google That For You[^].


Define the variable.
You might need to start with a book to learn some of the basics of the language.


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


这篇关于编译项目时的错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆