November 8, 2008

T-SQL string function: replicate

So you need to generate a custom code...

Since the REPLICATE string function repeats a string value a specified number of times, it can be used with an identity column to build a custom code like this:

[ Yes, well, the example is a bit trite but you get my point.
Actually...this string function could be FUN if you're into ascii art... ]
Syntax: REPLICATE ( string_expression ,integer_expression )
Arguments: string_expression - the string to replicate integer_expression - the number of times the string will be replicated
Returns: The Replicate function returns a sting expression.

November 6, 2008

SSIS/DotNetNuke module namespace error

While working on one of my side projects the other day, Visual Studio threw an ambiguous namespace error during a DotNetNuke website rebuild.
I had been developing a new DotNetNuke module (see previous posting) to serve as a graphical user interface (GUI) for our marketing department. The module enables them to run SQL Server Agent jobs that invoke SSIS packages on demand.
I'm posting the error and its solution here with hopes that it will assist someone.
'ZipEntry' is ambiguous in the namespace 'ICSharpCode.SharpZipLib.Zip'
Solution: Delete the ICSharpCode.SharpZipLib.dll and retain SharpZipLib.dll
Discussion: The error was thrown because a third party module had compiled the SharpZipLib source code into their assembly (ICSharpCode.SharpZipLib.dll) and placed it in the \DesktopModules\ThirdPartyModule\Bin directory.
This caused an ambiguous namespace error to be thrown because the DotNetNuke framework compiles the SharpZipLib source code as SharpZipLib.dll which is located in DotNetNuke's root \Bin folder.
Root cause: There is more than one assembly with the same namespace. Deleting the duplicate assembly and rebuilding the website resolves the problem.
Error thrown: Error: File Manager is currently unavailable. DotNetNuke.Services.Exceptions.ModuleLoadException: C:\DotNetNuke\Admin\Files\FileManager.ascx.vb(780): error BC30560: 'ZipEntry' is ambiguous in the namespace 'ICSharpCode.SharpZipLib.Zip'.