Feed on
Posts
Comments

Hi all, 

Right now I am doing a project with SSIS 2005 where we are building pretty cool stuff. Well I am not a very experienced SSIS developer so I ran into a very nice problem. I have to transport data from a SQL 2000 database to a SQL 2005 database. The dba created a stored procedure which gives me the incremental data from the SQL 2000 database. So I decided to use this stored procedure as the source of my SSIS package. At the end of the stored procedure there is a select * from #temptable. When I execute this stored procedure in the Query analyzer i see a lot of data divided into multiple columns. When I use this stored procedure as the source in my package and connect this component to the next component I receive a message. Something like do you want to proceed when you don’t have any input columns. Hmm a bit strange because the stored procedure does give me output columns. Well I found a very nice post who clarifies this problem. Check it out:

http://blogs.conchango.com/jamiethomson/archive/2006/12/20/SSIS_3A00_-Using-stored-procedures-inside-an-OLE-DB-Source-component.aspx

Because I was also working with SQL 2000 and wanted to check the metadata of the stored procedure I had to change the check query a bit, but this post was very helpful

SQL2000

select o.[name], c.* from syscolumns c
inner join sysobjects o on c.id = o.id
where o.[name] = ‘dbo.usp_COPArbeidsrelatieIncrementeel’

instead of: (SQL2005)

select o.[name], c.* from sys.columns c
inner join sys.objects o on c.object_id = o.object_id
where o.[name] = ‘dbo.usp_COPArbeidsrelatieIncrementeel’

OpenAJAX Hub

Since Microsoft joined the openAJAX alliance i have checked the site of openAJAX alliance maybe twice.  Today i am convinced that i have to do it more often. I read a very interesting article about the “OpenAJAX hub”. I admit i am a little late. The OpenAJAX Hub in one sentence, will be used to integrate multiple Ajax frameworks into one webpage. So when you want to use AJAXIUM and the ASP.NET AJAX controls in one webpage because both frameworks contain controls that you like to use in your webpage you have to use the OpenAJAX Hub. The hearth of the OpenAjax Hub is the Publish/ subscriber manager (they call it the pub/sub manager). This manager is responsible for managing events within the webpage. I could happen that Ajax Control A (Build with AJAXIUM) triggers an event which has to update Ajax Control B (build with ASP.NET AJAX). To let these controls communicate with eachother Control B has to subscribe to the event of Control A at the pub/sub manager. The manager will fix the interoperability between the different framework. For more information check this .

Regards

Building Ajax Control Part I

Hi,

In this post i will describe how to create you own control. In this post i will talk about the constructor, the prototype pattern, the initialize and dispose method. before we can use our constructor we have to define a namespace where our control resides in. We will do this with the following line:

Type.registerNamespace(”[namespace]“);

The constructor

Well the constructor should ring a bell to us developers. The constructor for an Ajax control is just the same.
It will receive an element which is the DOM element who is representing our Ajax control in the browser. Inside the constructor you should only define you variables not methods and properties (we will discuss this later).

[namespace].Control = function(element)

{

this._name = null;

this._pagesize = null;

}

the _ sign is used to make developers see that these variables are private. The only thing is you are able to use them public. This is not recommended, you should use the properties to get to your variables. But how does the Ajax framework comes to our control. Well when we create our control in the webpage we should do this with the $create method. This create method is a short notation for the Sys$Component$Create method which is defined inside the Ajax scriptlibrary. This method accepts 5 parameters:

  • type (the type of Ajax control you want to create)
  • properties (the properties the control has)
  • events (the events the control has)
  • references (the references the control has with other controls)
  • element (the DOM element which is representing the Ajax control)

I am not going to specify the method totally but, there is a specific line i would like to highlight:

var component = (element? new type(element): new type());

This line of code will trigger the constructor of our control. When you hit F11 when you are debugging you will step into the code of your control. As you can see in this line of code the element variable is used as a parameter. So the $create method receives the element and passes it through to the constructor of our control.

The prototype object

Like i said before you should not define your properties or methods inside your constructor. The prototype is a template for your control. You should use the prototype object to define you properties and method. The reason why, is because this is a more efficient way when dealing with memory. When you define the properties and methods inside the constructor and you create such an object. the properties and methods will be copied to the object everytime you create a new object. When you define the properties and methods inside your prototpye the properties and methods will be shared by each object that is instantiated. So this is much more effecient when creating multiple objects.

Initialize function

When you create your own control you are able to overwrite  the initialize method. You shoud do this when you want to initialize your properties, define delegates and hook up events to eventhandlers. When you overwrite this function you should always add:

YOURControl.callBaseMethod(this, ‘initialize’);

This is because you should always initialize the base class.

Dispose function 

Well the dispose method should be used to dispose al the references and processes you created in the intialize function. Think about delegates and and eventhandlers. When you don’t use this method to dispose your eventhandlers and delegetas you will receive an error when leaving the page where your control resides.

At the end you need to register your control:

[namespace].[controlname].registerClass(’[namespace].[controlname]‘, Sys.UI.Control);

in the registerClass method you can see that it takes 2 parameters. One is the control that is build and the second the class where it inherits (Sys.UI.Control). There is an option to add a third parameter. In this paramtere you can define interfaces which your control implements.

The control that is build is in a separate javascript file. You need to add the following line of code to communicate with the scriptmanager that you js file is loaded when it is needed/ referenced: 

if (typeof(sys) !== ‘undefined’) Sys.Application.notifyscriptLoaded();

The next post will be about Properties how these are defined and how the Ajax framework will act on it.

Improve Ajax Performance

Hi,

To improve the Ajax performance you should install windows script 5.7. This should help you fix the problem some browsers have with the Garbage Collector (GC). Check the following article for more information here. On the blog of Gurav Seth are the links to download windows script 5.7

Building Ajax Controls

In the upcoming weeks i want to describe how you can build your own Ajax Control. In these posts i will describe how a Control should look like, but also why it should be build that way. I will describe for each part of this subject how the Ajax framework will interact with our control. The subjects i want to describe are shown below:

  • Building Ajax controls part I (Control constructor + Prototype pattern + Initialize + Dispose)
  • Building Ajax controls part II (Define properties)
  • Building Ajax controls part III (Define Events)
  • Building Ajax controls part IV (Define Methods)
  • Building Ajax controls part V (Define References)
  • Building Ajax controls part VI (make control serverside available, Scriptdescriptor, Scriptreferences)

Naming convention

I see ( in code) and hear many times developers discussing naming convention. Should this paramater start with a capital character of not? In other words when should i use PascalCasing and when camelCasing? Well it could be confusing when you are talking to different developers with different ideas. Who is saying the right thing? (The discussion when is something right is not part of this post :) ). I am reading a book Framework design guidelines by Krzysztof Cwalina and Brad Abrams and they discuss this issue. I want to show you a table from this book which is very clear which naming convention you can use in which situation:

Identifier Casing Example
Namespace Pascal System.Security
Type Pascal StreamReader
Interface Pascal IEnumerable
Method Pascal public virtual string ToString();
Property Pascal public int Length { get; }
Event Pascal public event EventHandler Exited;
Fields Pascal public static readonly TimeSpan InfiniteTimeout;
Enum value Pascal FileMode{

Append,

}

Parameter Camel public static int ToInt32(string value);

This could be a good start when every developer is using the same naming convention. This will make it easier to read code from another developer, but this is just one piece there is more! This subject is just a paragraph in the book. If you want to know more about naming conventions and programming guidelines you should check the book. It is written very clear and easy to read.

Like all developers i read the blog of Scott Guthrie and saw more interesting stuff about VS 2008. We already knew that there will be Javascript intellisense available in VS 2008, but Scott shows some more details about it. There are a couple of cool feautres and two of them i am very excited about Script document navigation in the solution explorer and breakpoints in embedded javascript. In VS 2005 you are able to use the script explorer this is another pane that isn’t standaard visible in VS 2005. This explorer show all the scripts that have be loaded into you webpage. In VS 2008 this will be standard available and integrated in the solution explorer. Very cool!!

In VS 2005 we can’t set breakpoints in the JavaScript that is embedded in your HTML, only if you have JavaScipt in another file you are able to set a breakpoint. When it is embedded you have to work with keywords like ‘debugger’ or ‘Sys.Debug.fail(’FAIL’)’. In VS 2008 it is possible to add breakpoints to embedded Javascript. So working with Javascript will be more and more like working with C# in VS 2008. Check the blog of Scott Guthrie

A week ago i passed for the upgrade exam 70-553. This is a huge relief because it was a pretty big exam and i want to fix this exam before i can re-focus on the TFS exam i have to do later. I already posted before that i didn’t pass for my TFS beta exam (625) but now i am armed with the wrox book, so i have faith that i will succeed this time. The 70-553 exam contains 3 exams (Foundation, Web and Winform). After i finished my TFS exam i will take a look at 70-554 and hopefully i will finish this one at begin of 2008.

A few weeks ago I had a fight with the MSSCCI provider version 1.2. This version of the provider should work with branches in VS2003. Well because we have multiple developers on our project branches would be nice!!

Something that I have to say is that we converted our web application project to a class library project. This can give you some strange errors when you are working on a branched project.

Well the big difference between working with VS2003 with TFS and VS2005 with TFS, is that the solution file of your project will contain mappings for TFS and the local system (in the GlobalSection(SourceCodeControl) section).

The situation we created was, we had branched the (original) project folder to another folder (BranchA). The solution file which was also branched contained the old mappings of the original project for some projects (Wep Applications). Open your solution file with notepad and look for “SccProjectName”.

Michal Malecki from Microsoft was very helpful with this problem. We made changes to the .sln file (mappings to the right project in TFS) the local mappings were OK. The next thing he suggested is when you want to open your branched project, don’t do this with the source control explorer. You have to open it from VS2003 and select Open from source control. This will make the provider create MSSCCPRJ.SCC files. He will create one for the whole solution and one per project. When you open the branched solution within the source control explorer these files don’t get created a you will have bindings to your original project.

What does this file contain? This file contains only 2 rows:
• Workspace information
• The account you are using
• The Path to TFS where your project resides

A good summary would be branche your solution in the source control explorer and open it within VS2003. I hope this is helpful for you. i took me more then a day to fix this problem (with a lot of help from Michal Malecki, thanks)

« Newer Posts - Older Posts »