在内联.aspx页面中导入错误

时间:2022-06-18 18:07:15

I have a import directive in my inline .aspx page (no code-behind).

我的内联.aspx页面中有一个import指令(没有代码隐藏)。

Getting an error: The type or namespace name 'Dts' does not exist in the namespace 'Microsoft.SqlServer' (are you missing an assembly reference?)

获取错误:命名空间“Microsoft.SqlServer”中不存在类型或命名空间名称“Dts”(您是否缺少程序集引用?)

What is the issue? Do I need a /bin directory with the .dll in it or something?

有什么问题?我需要一个包含.dll的/ bin目录吗?

3 个解决方案

#1


4  

Sounds like there is no "project". In that case, to reference a dll (assembly) you use an <%@ Assembly > directive.

听起来没有“项目”。在这种情况下,要引用dll(程序集),请使用<%@ Assembly>指令。

<%@ Assembly Name="microsoft.sqlserver.manageddts.dll" %>
<%@ Import namespace="Microsoft.SqlServer.Dts.Runtime" %>

#2


1  

Does your project reference microsoft.sqlserver.manageddts.dll?

您的项目是否引用了microsoft.sqlserver.manageddts.dll?

#3


1  

Thanks! Don't you love SharePoint... I had to do Code Infront for a feature that referenced Oracle:

谢谢!你不喜欢SharePoint吗...我必须为Code Infront做一个引用Oracle的功能:

<%@ Assembly Name="System.Data.OracleClient, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" %>
<%@ Import Namespace="System.Data.OracleClient" %>

and then I can reference the classes from this OracleClient assembly: OracleConnection, OracleCommand, OracleDataReader

然后我可以引用这个OracleClient程序集中的类:OracleConnection,OracleCommand,OracleDataReader

Bad part was, I got no compilation errors, and had to use the wonderfully useful SmartPart (son-of or "ReturnOfSmartPartv1_3.wsp" from codeplex: http://smartpart.codeplex.com/).

不好的部分是,我没有编译错误,并且必须使用非常有用的SmartPart(来自codeplex的儿子或“ReturnOfSmartPartv1_3.wsp”:http://smartpart.codeplex.com/)。

I got no compile errors but it was showing nothing for my SharePoint Feature (from a code-inline ASCX)... I actually did have compile errors but it "said" it succeeded compiling in VS.NET... so I used SmartPart to do host the control with everything commented out, then I uncommented and hit F5/refresh.

我没有编译错误,但它没有显示我的SharePoint功能(来自代码内联ASCX)...我确实有编译错误,但它“说”它成功编译VS.NET ...所以我使用SmartPart用注释掉的所有内容来控制控件,然后我取消注释并点击F5 / refresh。

I got compilation errors - with line numbers - in the SmartPart container! Funky cool!! So now my ASCX works just fine since I can use SmartPart to see it work or not and if not, WHY!

我在SmartPart容器中遇到了编译错误 - 包含行号!时髦酷!!所以现在我的ASCX工作正常,因为我可以使用SmartPart看它是否有效,如果没有,为什么!

#1


4  

Sounds like there is no "project". In that case, to reference a dll (assembly) you use an <%@ Assembly > directive.

听起来没有“项目”。在这种情况下,要引用dll(程序集),请使用<%@ Assembly>指令。

<%@ Assembly Name="microsoft.sqlserver.manageddts.dll" %>
<%@ Import namespace="Microsoft.SqlServer.Dts.Runtime" %>

#2


1  

Does your project reference microsoft.sqlserver.manageddts.dll?

您的项目是否引用了microsoft.sqlserver.manageddts.dll?

#3


1  

Thanks! Don't you love SharePoint... I had to do Code Infront for a feature that referenced Oracle:

谢谢!你不喜欢SharePoint吗...我必须为Code Infront做一个引用Oracle的功能:

<%@ Assembly Name="System.Data.OracleClient, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" %>
<%@ Import Namespace="System.Data.OracleClient" %>

and then I can reference the classes from this OracleClient assembly: OracleConnection, OracleCommand, OracleDataReader

然后我可以引用这个OracleClient程序集中的类:OracleConnection,OracleCommand,OracleDataReader

Bad part was, I got no compilation errors, and had to use the wonderfully useful SmartPart (son-of or "ReturnOfSmartPartv1_3.wsp" from codeplex: http://smartpart.codeplex.com/).

不好的部分是,我没有编译错误,并且必须使用非常有用的SmartPart(来自codeplex的儿子或“ReturnOfSmartPartv1_3.wsp”:http://smartpart.codeplex.com/)。

I got no compile errors but it was showing nothing for my SharePoint Feature (from a code-inline ASCX)... I actually did have compile errors but it "said" it succeeded compiling in VS.NET... so I used SmartPart to do host the control with everything commented out, then I uncommented and hit F5/refresh.

我没有编译错误,但它没有显示我的SharePoint功能(来自代码内联ASCX)...我确实有编译错误,但它“说”它成功编译VS.NET ...所以我使用SmartPart用注释掉的所有内容来控制控件,然后我取消注释并点击F5 / refresh。

I got compilation errors - with line numbers - in the SmartPart container! Funky cool!! So now my ASCX works just fine since I can use SmartPart to see it work or not and if not, WHY!

我在SmartPart容器中遇到了编译错误 - 包含行号!时髦酷!!所以现在我的ASCX工作正常,因为我可以使用SmartPart看它是否有效,如果没有,为什么!