Friday 27 August 2010

Microsoft Tech Ed 2010 Gold Coast Meter-Maids in SMH...a bit of poor form?

I'll leave you to be the judge with these Photos from Tech Ed 2010 - http://www.smh.com.au/technology/technology-news/meter-maids-stunt-backfires-at-microsoft-geek-gathering-20100826-13t2f.html

The organizers were fully aware of what they were doing and I thought it was on par with what you see at any motorshow - so didn't think much of it.

DDK

Wednesday 25 August 2010

Just got 900/1000 for Biztalk 2006 R2 Exam (70-241) at Australian Tech Ed 2010 on the Gold Coast!

The Biztalk exams don't have any official training materials. After trawling through 2 Apress Biztalk books (including Apress Pro Biztalk 2009), all the Microsoft 2009 Virtual Labs and a SoA Book (~1300 pages in total), I sat the exam this afternoon.

As usual, many of the questions are slightly ambiguous and I did a lot of "um-ing" and "ahh-ing" before a decided to click the "Exit Exam" button. Thankfully the numbers went my way. Updated MCP logo including my Biztalk cert will appear soon!

DDK

Monday 23 August 2010

"The one-way operation returned a non-null message with Action=''." Error when calling a SAP Web Service from a MS .NET WCF Client

I received the following exception today when attempting to call a new service in SAP PI (Process Integration), the equivalent of MS Biztalk in the SAP world:

The one-way operation returned a non-null message with Action=''.

Using WireShark, I looked in on the HTTP traffic:



Looking closely, it turns out that SAP returns an Empty SOAP body in the response (ie NOT just a blank string/nothing) as per the screenshot below:


As discussed here http://www.go4answers.com/Example/exception-while-making-way-call-wcf-56416.aspx   , there is a hotfix for the issue that can be found at  http://forums.sdn.sap.com/message.jspa?messageID=9031931 
- however the simplest fix is to handle the System.ServiceModel.ProtocolException and effectively ignore this exception.

//Execute call
            var client = WCFClientFactory.CreateClient(CredentialType.PI);
            try
            {
                client.SI_EmpSave_Async_Out(empObj);
            }
            catch (System.ServiceModel.ProtocolException ex) //Just handle this specific exception. 
            //Otherwise bubble up
            {
                if (!ex.Message.Equals("The one-way operation returned a non-null message with Action=''."))
                    throw;
            }

DDK

Thursday 12 August 2010

Microsoft Windows Azure Platform WILL be available as an on-premise solution - via a Turnkey "Appliance"


One of my biggest qualms about recommending a cloud-based solution (esp for sensitive data) is that the solution is then completely bound to hardware under a particular vendor's (e.g. Microsofts or Amazon's) control. This in turn makes it hard to sell to clients who typically like to have complete control over their data (whether this concern is well-founded is another debate).

Last month, Microsoft made moves to circumvent this reaction by announcing an "Appliance" - which is a specially configured box that will be able to be purchased for use in-house. Costs have not been announced - and it is only available to be used by a select pilot customers (in a "Limited Production Release") like Dell, Ebay, HP and Fujitsu.

However, it is a move in the right direction - to making the Azure business model appropriate in more business contexts - and without the variable (and somewhat unpredictable) expenses normally associated with a cloud-based (or any transaction/CPU cycle/storage fee-based) solution. Yet they still retain many of the seamless scalability advantages offered by Azure.

For more details on the Azure appliance, see:
http://www.microsoft.com/windowsazure/appliance/

DDK

Team Foundation Server 2010 (TFS) Licensing Whitepaper

You can find a very comprehensive document on licensing TFS 2010 from Microsoft) at the following location
http://download.microsoft.com/download/7/B/1/7B18407A-AC79-4949-A318-A6636D96F497/Visual%20Studio%202010%20Licensing%20-%20Feb-2010.pdf

See page 15-20 for details on how TFS is licensed. You get 5 CALs out of the box which is a good deal for smaller development teams - plus no CALs are required for basic use of the worklists. It also details the User Vs Device CAL conditions, and how the External Connector License works.

Note that you must get CALs for "internal" users - internal users cannot use the External connector license.  The definition of External users is as follows (though this definition is somewhat vague and open to interpretation):
"External users are defined as users that are not employees of the organization or its affiliates, nor are they employees of the organization’s or its affiliates’ onsite contractors or agents."

DDK

Tuesday 10 August 2010

SharePoint 2007 - Finding Group Membership of Users (Active Directory or SharePoint) through UserProfileService.asmx

By using the SharePoint 2007 (and above) Out-Of-The-Box "User Profile" Web Service found at the following location:
http://ServerName/_vti_bin/UserProfileService.asmx

You can easily obtain information about the group membership (both Active Directory and SharePoint Groups) of a particular user - not just their basic user profile information (e.g. Mobile, Manager). This can be done with the GetCommonMemberships() method.

In this way, without code and without directly accessing Active Directory/LDAP, you can find the group memberships of a user for consumption in an InfoPath form by consuming it as a Web Service-based datasource.

For implementation details of a code-free InfoPath consumption of this web service, see: 
http://claytoncobb.wordpress.com/2009/07/19/infopath-user-roles-in-browser-enabled-forms-using-groups/

DDK

Sunday 8 August 2010

Location of Microsoft.SqlServer.Dts.Runtime when Programmatically Running an SSIS 2008 Package

If you are having problems finding the DLL to reference to programmatically run an SSIS Package, you should find it in the following location:

%Program files%\Microsoft SQL Server\100\SDK\Assemblies\Microsoft.SQLServer.ManagedDTS.dll

Take note that you may have several directories under %Program files%\Microsoft SQL Server\ if you have upgraded through different versions of SQL Server. Try looking through each of these to find the correct version of Microsoft.SQLServer.ManagedDTS.dll
So assuming you installed it on C:\, you should find it in:

For SQL 2005:
C:\Program files\Microsoft SQL Server\90\SDK\Assemblies\Microsoft.SQLServer.ManagedDTS.dll
For SQL 2008:
C:\Program files\Microsoft SQL Server\100\SDK\Assemblies\Microsoft.SQLServer.ManagedDTS.dll

If you still can't find the Assembly, make sure you've installed the Client Tools SDK as shown below:



DDK

Entity Framework 4 Limitation - [System.NotSupportedException] - "LINQ to Entities does not recognize the method 'System.String ToString()' method, and this method cannot be translated into a store expression."

I received this System.NotSupportedException at runtime (not design time) today when attempting a conversion of a Nullable Integer field to a string for population of an ASP.NET MVC 2 dropdownlist:

"LINQ to Entities does not recognize the method 'System.String ToString()' method, and this method cannot be translated into a store expression."

I was consuming an Entity Framework Datamodel indirectly (via a model) via a call to the Html.DropDownListFor() method:

<div class="editor-field">
<%: Html.DropDownListFor(model => model.Year, ViewData.Model.YearList) %>
<%: Html.ValidationMessageFor(model => model.Year) %>
</div>

The best workaround for this issue I've found (that keeps all processing happening in SQL Server rather than doing a client-side evaluation/enumeration) is using the SqlFunctions.StringConvert method:

public IEnumerable YearList 
        {
            get
            {
                var list = new WorkforceEntities().Collections;
                return list.Select(a => new SelectListItem()
                {
                    Text = SqlFunctions.StringConvert((double)a.FinancialYear),
                    Value = SqlFunctions.StringConvert((double)a.FinancialYear.Value)
                }).Distinct().ToList();
            }
        }

Unfortunately this is a limitation of the Entity Framework versions 1 and 2 - as .ToString() is not one of the supported CLR to Database Canonical Model translations as detailed here: http://msdn.microsoft.com/en-us/library/bb738681.aspx

Ensuring the server side evaluatation takes place is more important if we were filtering this list - but the golden rule and preferred outcome is the same - to minimize the amount of data going across the wire.

Checking SQL Profiler on the SQL server side, this evaluates to the following T-SQL in SQL Server:

SELECT 
[Distinct1].[C1] AS [C1], 
[Distinct1].[C2] AS [C2], 
[Distinct1].[C3] AS [C3]
FROM ( SELECT DISTINCT 
 1 AS [C1], 
 STR( CAST( [Extent1].[Quarter] AS float)) AS [C2], 
 STR( CAST( [Extent1].[Quarter] AS float)) AS [C3]
 FROM [cfg].[Collection] AS [Extent1]
)  AS [Distinct1]

Which is using all SQL Server Canonical Functions - as best practice (performance-wise) dictates.

DDK

Saturday 7 August 2010

SSIS 2008 - "Unspecified error" and "Could not find installable ISAM" Errors After installing Office 2010 and Visual Studio 2010

I recently installed Office 2010 on one of my development machines. Suddently, all of my SQL Server 2008 SSIS packages started to generate errors (when attempting to preview data outputs) to the tune of:


Error at PackageName [Connection manager "ImportFileSource"]: SSIS Error Code DTS_E_OLEDBERROR. An OLE DB error has occurred. Error code: 0x80004005.


An OLE DB record is available. Source: "Microsoft Access Database Engine" Hresult: 0x80004005 Description: "Unspecified error".


Error at ImportDataTaskName [OLE DB Source 1 [3639]]: SSIS Error Code DTS_E_CANNOTACQUIRECONNECTIONFROMCONNECTIONMANAGER. The AcquireConnection method call to the connection manager "ImportFileSource" failed with error code 0xC0202009. There may be error messages posted before this with more information on why the AcquireConnection method call failed.
------------------------------
ADDITIONAL INFORMATION:
Exception from HRESULT: 0xC020801C (Microsoft.SqlServer.DTSPipelineWrap)

The SSIS package tasks that had the issues were using a connection string pointing to the Office 12 OLEDB drivers like so:

Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\temp\FileName.xlsx;Extended Properties="Excel 12.0";Persist Security Info=False"

If you then attempt to do a test run with the same connection string, it will also fail with the following error:

Test connection failed because of an error in initializing provider. Could not find installable ISAM.


The cleanest and most reliable way to fix this issue when using 2007 drivers (rather than attempting to reregister the neccessary dlls or if there are other issues), is to just just install or re-install the "2007 Office System Driver: Data Connectivity Components" - available at the following location:
http://www.microsoft.com/downloads/details.aspx?FamilyID=7554f536-8c28-4598-9b72-ef94e038c891&displaylang=en

Alternatively you could also just try re-registering the dlls as described here:
http://support.microsoft.com/kb/209805
DDK

Wednesday 4 August 2010

Fix - ASP.NET ReportViewer for SSRS not Rendering in IIS 7.0 or 7.5

Fix - If you are unable to render the ReportViewer Control on your ASP.NET Web pages while running on IIS7, the typical cause of this problem is:
  1. When the ReportViewer control is added to Web Form (.aspx), the Reserved.ReportViewerWebControl.axd httpHandler is added to System.Web section of the Web.Config file. In IIS7, it should be added under System.WebServer section.
  2. IIS7 Handler Mappings does not contain the Reserved.ReportViewerWebControl.axd httpHandler, and is therefore unable to render the ReportViewer elements needed by the JavaSript.
See http://otkfounder.blogspot.com/2007/11/solving-reportviewer-rendering-issue-on.html  for a fix.

DDK

Fix - IIS 7.0 and 7.5 Not Rendering CSS Files or other static content with Error 500 or Blank Pages

During a deployment for a client today of a custom ASP.NET application, IIS 7 refused to render external css files correctly - just spitting out Error 500 or blank content.  This happens because IIS 7 and 7.5 do NOT render static content by default - which is a little surprising but not completely unexpected.

To fix for Windows Server 2008:
  1. Open up Start - Administrative Tools - Server Manager on the Front End web server in question.
  2. Select Web Server (IIS) under Roles
  3. Click on "Add Role Services"
  4. Enable the "Static Content" checkbox.
  5. In IIS 7, Click on the Website and double click Handler Mappings
  6. Right click on "StaticFile" and click "Edit" .
  7. In the Module Field add "StaticFileModule,DefaultDocumentModule" and click OK
  8. DONE - FIXED!
The official support document for this on the MS site can be found here:
http://support.microsoft.com/kb/2196177

DDK

Installing the Crystal Reports Runtime on a Web Server when trying to deploy Crystal Reports Developed in Visual Studio 2008

My preference is to use SQL Server Reporting Services (SSRS) as an application reporting engine where possible - but one of my clients had a requirement to create reports in Crystal Reports. The reports were designed in Visual Studio 2008 and consequently use the Crystal Reports 2008 Basic engine. When you deploy an application onto a server, you will get an error in the event log and an image placeholder where the report should be.

If you want to deploy your app on a server, you'll also need to deploy the CR runtime for your reports to render correctly. The official way to do this (rather than trying to install all the DLLs you can find to the gac) is to use the installer. The easiest way to get this is from your local drive (where you installed visual studio). It is typically located here:

%Program Files%Microsoft SDKs\Windows\v6.0A\Bootstrapper\Packages\CrystalReports10_5


DDK