tags:

views:

777

answers:

3

Hi,

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

<%@ Import namespace="Microsoft.SqlServer.Dts.Runtime" %>

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

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

+1  A: 

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

Will
+1  A: 

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

<%@ Assembly Name="microsoft.sqlserver.manageddts.dll" %>
<%@ Import namespace="Microsoft.SqlServer.Dts.Runtime" %>
Joel Coehoorn
is the .dll suppose to be in lower case like that?
Blankman
I doubt it matters, but it wouldn't hurt to match case. Rather than re-type I just copy/pasted the name from Will's post.
Joel Coehoorn
you do realize that now programmers around the world are going to make that same 'casing' mistake :) (thanks!)
Blankman
Earn another 929 rep and you can fix it yourself. Here: have 10 to get you started. ;)
Joel Coehoorn
A: 

Thanks! Don't you love SharePoint... I had to do Code Infront for a feature that referenced 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

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/).

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.

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

Dan Wygant