.NET 2005中的名称空间问题 [英] Name space problem in .net 2005

查看:58
本文介绍了.NET 2005中的名称空间问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我正在使用.net 2005,试图放置名称空间
使用Excel;
在我的应用程序中导入和导出excel数据表,但在名称空间中显示错误.
我该怎么办?
请帮忙

谢谢与问候
Indrajit dasgupta

Hi All,

I m using .net 2005 i m trying to put name space
using Excel;
for excel datasheet import and export in my application but it is showing error in name space.
what should I do ?
Please help

Thanks & regards
Indrajit dasgupta

推荐答案

您可能需要包括对Excel Interop dll(Microsoft.Office.Interop.Excel.dll)的引用.
You probably need to include a reference to the Excel Interop dll (Microsoft.Office.Interop.Excel.dll).


您好,

你可以尝试一件事
使用此语法
Hi,

You can try one thing
use this syntax
using Microsoft.Office.Interop.Excel;



为此,您需要添加
的引用 "Microsoft.Office.Interop.Excel"

问候
AR



For this you need to add refrence of
"Microsoft.Office.Interop.Excel"

Regards
AR


在任何版本的.NET中,任何名称空间都没有任何问题.

唯一的问题是无法引用项目所需的程序集.通常,当编译失败时,它会告诉您应将哪个程序集添加到项目的引用列表中.不是GAC程序集或注册的COM组件,情况并非如此.

您需要的程序集在GAC中,其名称为"Microsoft.Office.Interop.Excel".


(Ankit提到了.)

添加程序集引用后,在项目资源管理器"中单击其节点.它将打开参考树,您可以在其中浏览并找到您的命名空间.在"using"中使用所需的内容.

—SA
There are no any problems with any name spaces in any version of .NET.

The only problem is failure to reference assemblies required by your project. Usually, when a compilation fails, it tells you what assembly should you add to the reference list of your project. It is not the case if it is not the GAC assembly or a registered COM component.

The assembly you need is in GAC, its name is "Microsoft.Office.Interop.Excel".


(Ankit mentioned it.)

When an assembly reference is added, click on its node in Project Explorer. It opens the tree of references where you can browse and find out your name spaces. Use what you need in "using".

—SA


这篇关于.NET 2005中的名称空间问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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