Languages

Creating SQL temp table

When writing SQL queries, especially the sp (stored procedure), temp table (temporary table) can create difficulties arise. At least you need to create delete the temporary table. The way to overcome this difficulty, such as the following to create a temporary table to use.


DECLARE @TMP_TABLE_NAME(
FIELD_ID INT IDENTITY(1, 1),
FIELD_1 INT,
FIELD_2 INT,
FIELD_3 NVARCHAR(MAX)
)

Which Version of Team Foundation Server 2008 (TFS) am I using?

If you are curiese about which version of Team Foundation Server you are using, follow this steps:

  • Open regedit
  • Find this path: Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\9.0\TeamFoundation\Registration

You’ll see “Edition_CT” key.  If this key value is “Workgroup” your TFS version is Team Foundation Server Workgroup Edition. If this key value is “Full” your TFS version is Team Foundation Server Standart Edition.

Easy javascript AJAX with Mootools

We most used Ajax requests the following snippet of code will make your life easier. Mootools “Request” function is used in this code. The next article in this function we’ll see how ASP.NET.

Sensei = {};
Sensei.Send = function(URL, fName, prms, retryCount, OnComplete) {
	if (retryCount == null) retryCount = 0;
	var jsonRequest = new Request(
		{
                'encoding' : 'utf-8',
		method: 'post',
		url: URL,
		onComplete:  OnComplete,
		onFailure: function(){
					if(retryCount<3)
						Sensei.Send(URL, fName, prms, OnComplete, retryCount++);
		},
       }).send('m=' + fName + '&' + prms);
};

How to use :

Sensei.send("service/serviceurl.ashx","doIt","cId=5&bId=5",0, function(result){
      alert(result);
});

Select box styling with mootools (fake combo)

As you know, ’select box’ is a special control and its style cannot be changed very much. For example the height property can be changed in Firefox, but it can’t be changed in IE. Instead of creating a formal select box, our aim is to create a virtual select box whose properties can be adjusted. It should only include HTML codes, so it will give the same result in all browsers.

This select box also changes all the select boxes automatically when you add JS and CSS into the page. Using this component is totaly up to your talent.

Working Model: It scans all the select boxes in your page. It hides adding the “Multiple” tag. It inserts a <div> into its location and shows the real select box when it is clicked that you made “Multiple”. Thus you can select the items in your real select box.

combo1

Working Example : http://www.cihantopcu.com/samples/fakecombo/index.html

For download : http://www.cihantopcu.com/samples/fakecombo/fakecombo.rar

This control based to http://www.cult-f.net/2007/12/14/elselect/