Saturday, December 07, 2013

Deploy a WCF Service in IIS without a SVC file

WCF 4.0 provides a feature called Configuration-Based Activation, with which the information normally included in the .svc file directly into the Web.config file for a WCF service hosted by IIS.

To do this, add a section to the part of the configuration file and provide values for the relativeAddress and service elements.

The relativeAddress element should be a string that looks like a filename with the .svc extension, and the service element should specify the fully qualified type that implements the WCF service.

<serviceHostingEnvironment multipleSiteBindingsEnabled="true">
<serviceActivations>
<add relativeAddress="NoServiceFile.svc" service="XXXXX.XXXXXServiceImpl" />
</servicaActivations>
</serviceHostingEnvironment>

Thursday, November 07, 2013

.NET User Group: WCF Data Services vs ASP.NET Web API

Presentation slides and code downloads:

Responses to some of the Questions

a) How do I issue PUT, POST or DELETE command?

This cannot be done directly using URL but can be done using Fiddler provided the HTTP verbs are allowed in the website (which can be configured in IIS)

Possible URI conventions: http://msdn.microsoft.com/en-us/library/dd728283(v=vs.110).aspx

b) Can WCF Data Services can be used without Entity Framework?

WCF Data Services is tightly coupled with Entity Framework. That's why it is quick and easy to generate the service. Still you can use WCF Data Services without entity framework with custom provider which will defeat the purpose (Quick and easy).

c) Is it possible to add the WCF Data Service as a Service Reference in other .NET project types?

Yes, this can be done as it is a typical Service (.svc) file.

Sunday, November 03, 2013

Dropping a Temporary table in SQL SERVER

IF OBJECT_ID('tempdb..#TABLENAME') IS NOT NULL
   DROP TABLE #TABLENAME

"[OLE DB Destination [48]] Error: The input "OLE DB Destination Input" (61) cannot be set to redirect on error using a connection in a transaction

Problem

This issue raises if you try to use TransactionOption Required in SSIS while you have error rows to redirect between an OLE DB Source and an OLE DB Destination.

Solution

Instead try using a 3 Execute SQL tasks in the Control Flow with the first one before the data flow task with SQLStatement BEGIN TRANSACTION.

Put the rest of the 2 Execute SQL tasks in the Control Flow below the Data Flow Task with the precedence Constraint set for one as 'Failure' with the SQLStatement ROLLBACK TRANSACTION and the other one with the precedence Constraint set as 'Success' with the SQLStatement COMMIT TRANSACTION

Note: Also make sure to set the RetainSameConnection property on the appropriate ConnectionManager to True.

Wednesday, September 18, 2013

Microsoft TechEd 2013 - NZ

Attended TechEd this year (2013). It's been full of interesting sessions. It was so easy to pick my sessions as my prime focus was around Cloud, Database and Architecture sessions.

Missed the Keynote session as I didn't reach Auckland until 8pm on Tuesday (10/09/2013). Caught up with my HP friend for a Hot Chocolate and went to bed.

I was ready in the morning and caught up with Glassboy for breakfast and collected my Registration pack and was ready for Scott Guthrie's session on Cloud (of course Windows Azure)

It was a full on session went for 2 Parts.

I was playing with Windows Azure recently and I am impressed especially when Scott mentioned that they do numerous releases to production (for features) every day.

Then another important session I really enjoyed was "Largest SQL and Azure Projects in the World".

Glad to hear that SQL Server can handle Terabytes and Terabytes of data.....

There were other good sessions like "Benefits Dependency Network to bring business and IT changes together", "Panel discussion failure of DW projects", "Performance Tuning Analysis Services Cube" etc...

Food was ok but can cater better for Vegetarians and Vegans.

HUB was so crowded and not really keen on the stands this time.

Met my Swedish friend at the stands......

Next year TechEd.....Keen but need to see how the rest of year goes......

Sunday, August 25, 2013

Database Sharding

Sharding is a type of database partitioning that separates very large databases the into smaller, faster, more easily managed parts called data shards. The word shard means a small part of a whole.

Horizontal partitioning is a database design principle whereby rows of a database table are held separately, rather than being split into columns (which is what normalization and vertical partitioning do, to differing extents). Each partition forms part of a shard, which may in turn be located on a separate database server or physical location.

There are numerous advantages to this partitioning approach. Since the tables are divided and distributed into multiple servers, the total number of rows in each table in each database is reduced. This reduces index size, which generally improves search performance. A database shard can be placed on separate hardware, and multiple shards can be placed on multiple machines. This enables a distribution of the database over a large number of machines, which means that the database performance can be spread out over multiple machines, greatly improving performance. In addition, if the database shard is based on some real-world segmentation of the data (e.g., European customers v. American customers) then it may be possible to infer the appropriate shard membership easily and automatically, and query only the relevant shard

Disadvantages

Sharding requires developers to think about things like rollbacks, constraints, and referential integrity across tables within their applications when these types of concerns are best handled by the database. It also makes other common operations such as joins, searches, and memory management very difficult. In short, the very solution implemented to overcome throughput issues becomes a bottleneck in and of itself.

Examples

MongoDB supports sharding from version 1.6

Solr enterprise search server provides sharding capabilities

Microsoft supports sharding in SQL Azure through "federations"

Monday, May 20, 2013

SQL Server 2012 New Features - Contained Database

One of the problems in the existing database model is data being left behind when an application is moved from one instance to another.  Some data connected with an application, (for example, login information and agent job information) is currently stored within the instance instead of inside the database and When you move a non-contained database application from one instance to another instance of SQL Server, this data is left behind.

Later on, DBA's need to identify the data which was left behind and move it with the application to the new instance of SQL Server. This process can be time consuming and difficult.

This is where Contained Databases will be really useful.

Separates the database application from the management of SQL Server

Users can connect to the database without authenticating a login at the Database Engine level

Applications within contained databases can be isolated from other databases from the instance of SQL Server, on which they reside, simplifying development and management

SQL Server 2012 New Features - Pagination

Pagination in SQL SERVER 2012 is now very easy, previously ROW_NUMBER(), TOP, Order BY clauses need to be used to get similar output.

Using OFFSET and FETCH is bit faster than using ROW_NUMBER(), TOP, Order BY clauses and very simple to use for Ad-Hoc paging.

OFFSET: Specifies the number of rows to skip before it starts to return rows from the query expression. The value can be an integer constant or expression that is greater than or equal to zero.

FETCH: Specifies the number of rows to return after the OFFSET clause has been processed. The value can be an integer constant or expression that is greater than or equal to one.

Saturday, May 18, 2013

SQL Server 2012 New Features - Sequence Objects

Sequence objects in SQL Server 2012 are similar to the ones in ORACLE and DB2

Allows to generate numeric values specified at the time of creation of sequence

They are similar to the IDENTITY Column with a difference being IDENTITY column is table specific while sequence objects are table independent.

Sequence objects are much faster in generating numbers than IDENTITY

.NET User Group Meeting - Data Centric Applications using LightSwitch 2012

Going to present on Data Centric Applications using LightSwitch 2012 at the .NET User Group next month. Drop in and enjoy the session.

http://www.meetup.com/WelliDotNet/events/118974032/

Need to build a nice front end for a new or legacy database with minimum amount of code? Want to build an application that can be deployed as Windows or Web application?

LightSwitch, Microsoft's Rapid Application Development (RAD) environment for developing data centric Line of Business (LOB) applications. LightSwitch allows you to connect to various data sources (SQL Server, Oracle, OData feeds, SharePoint lists etc) and create front-ends using Silverlight or HTML5 client.

This session will take you through the architecture, scenarios on when to use and not to use, Silverlight and HTML5 front end demos and Deployment of LightSwitch applications.

Wednesday, June 19 2013

Saturday, May 11, 2013

The SQL Server instance that you are trying to connect does not include an installation of Data Quality Services.

The SQL Server instance that you are trying to connect does not include an installation of Data Quality Services. To finalize the installation of Data Quality Services (DQS) please run the DQS installer script.

This error occurred when trying to connect to the SQL2012 instance using DQS Client. Make sure to run the Data Quality Server Installer under Microsoft SQL SERVER 2012 > Data Quality Services and then try connecting to the SQL2012 instance again.

SQL 2012 New Features - Column Store Indexes

Stores data in columns instead of storing in rows

Enables accessing data in easy and fast manner.

Improves processing time of Data Warehouse (DW) queries by hundreds to thousands times

To improve query performance, you need to build a column store index on the fact tables in a DW.

CREATE COLUMNSTORE INDEX [Index_Name] on [table_name] (Column_Name)

Monday, May 06, 2013

Linked SQL Server database giving “inconsistent metadata” error

When I query the table via a Linked server, I get the following error.

Inconsistent Metadata

The workaround for this is to use OPENQUERY.

SELECT * FROM OPENQUERY(LinkedServerName, 'SELECT * FROM DBName.Schema.Table')

Analysis Services - A connection cannot be made. Ensure the server is running

Analysis Services Project - A connection cannot be made. Ensure the server is running.

Right click on the project in solution explorer and click on properties and select deployment on the left hand side and change the server name to the Analysis server name. (default server name is localhost)

Tuesday, April 23, 2013

Cookie Aware Web Client on .NET Framework 3.5

Have been working on a project where I needed to download some files from a website which uses forms authentication.

I created a console application using VS 2010 targeting .NET framework 4.0 and used the Cookie Aware version of WebClient class.

The authentication cookie is stored and the files were downloaded successfully.

Unfortunately the code doesn't work once I started targeting .NET framework 3.5

To make the authentication cookie to be stored, the authentication need to be performed twice to make it to work in .NET framework 3.5

Monday, April 22, 2013

Professional Scrum Developer - Scrum.org

Recently I have passed my Profession Scrum Developer Assessment and attained the PSD 1 certification

I attended the PSD Course but you get only 2 attempts to pass the assessment

I took the open assessments few times and also read the material provided with my course

Need to focus on the Professional Scrum Master Assessment but really need some break before the new certification

Friday, March 22, 2013

Windows Phone 8 SDK on Windows 8 32-bit?

Windows Phone 8 SDK cannot be installed on Windows 8 32-bit machines instead it requires 64 bit. This is because Hyper-V Emulator can run only on 64 bit systems. Also because of 32 bit OS cannot address more than 3GB RAM.

Sunday, March 17, 2013

SFTP using SSIS 2008 & 2008 R2

SSIS doesn't have a built-in component to support SFTP but the following codeplex component can be used or create a script task and write the SFTP file retrieval.

http://ssissftp.codeplex.com/

Note:

  • Copy the SSISSFTPTask100.dll to C:\Program Files(x86)\Microsoft SQL Server\100\DTS\Tasks\
  • Register the SSISSFTPTask100.dll in the GAC using gacutil.exe (available under C:\Program Files(x86)\Microsoft SDKs\Windows\v7.0A\Bin)
  • Open BIDS and click Tools > Choose Toolbox items > SSIS Control Flow Items > SFTP Task (Note: The SFTP Task will appear only if the SSISSFTPTask100.dll has been successfully registered in the GAC.

Monday, February 25, 2013

Your current security settings do not allow this file to be downloaded

I get the above error when trying to download files from codeplex on a VM (Windows server 2008 R2) on IE9.

Solution

  • Open Internet Explorer.
  • Click Tools and then options.
  • Click on the security tab.
  • Select the Internet Zone.
  • Click on the Custom Level Button and then scroll down to Download.
  • Make sure to enable File download.
  • Click Apply and Ok