Wednesday, July 28, 2010

SQL SERVER – Delete Duplicate Records

Following code is useful to delete duplicate records. The table must have identity column, which will be used to identify the duplicate records. Table in example is has ID as Identity Column and Columns which have duplicate data are DuplicateColumn1, DuplicateColumn2 and DuplicateColumn3.

DELETE
FROM MyTable
WHERE ID NOT IN
(
SELECT MAX(ID)
FROM MyTable
GROUP BY DuplicateColumn1, DuplicateColumn2, DuplicateColumn3)

Wednesday, July 14, 2010

div element

What is a div element? A div element is a block of content that can be positioned anywhere on your site by using absolute positioning and the
tag. The purpose of div elements is to hold content, whereas frames hold pages. This content can be placed anywhere on your site and it can even overlap. The content can consist of images or html. All of the style elements like scrollbar color and font color can be controlled by a simple style sheet.



How do I make a basic div block? This is the code for a basic div:



Content goes here (images, text)




In the above code, there are a few variables that need to be defined:


•id: This is just the number of your div. It helps you sort out easily which div element is which when you have many layers. It's also useful for identifying layers so that you can have different style attributes in your style sheet for each div element.


•Top: This is the number in pixels that your div element will be positioned horizontally from the top of the page. If you give "top" a number value of "20," your div element will be 20 pixels down from the very top of your page.


•Left: This is the number in pixels that your div element will be positioned vertically from the left of your page. If you give "left" a number value of "20," your div element will be 20 pixels left from the very left side of your page.


•Width: This is the width of your div element in pixels.


•Height: This is the height of your div element in pixels.


•Z-index: This is the order in which your div elements are stacked, or overlapped. The number 1 would be the first layer, and the layer closest to the background of your site. The number 2 would be stacked on top of number 1, etc. You can remove this tag if you are using layers that you do not want to overlap.


•Padding: This is the margin of your div element in pixels. For instance, if you have text in your div element, you'll need margins so that the text doesn't go from one end of the div element to the other. This tag acts just like the cellpadding tag for tables.


•Border: This is the border of your div element in pixels. If you don't want a border, remove this variable. You can have a border that is solid, dottted, dashed, double, groove, ridge, inset, or outset.


•Background-image: This is the background image of your div element for IE.


•Layer-background-image:This is the background image of your div element for Netscape.










How do I make a div element that scrolls? Adding the "overflow:auto" tag to your div element will make it scrollable, like a text area:



Your text and images would go here



In the above code, you can position the div element by adjusting the numbers in bold.












How do I change the div scrollbar color? (IE only) You can use this method to change the color of your individual div element scrollbars. Using a style sheet makes your scrollbars all the same color. If you want a different color for a particular div, you can use this method, substitute your own 6 digit color number where you see bold text:



Content here



Thursday, July 8, 2010

Bing Map Virtual Earth intellisense

Bing Map Virtual Earth intellisense

Sample Soution

The solution can be downloaded from: http://www.aggregatedintelligence.com/Samples/VEandWS/VEandWS.zip

Reference:

* Virtual Earth SDK reference: http://dev.live.com/virtualearth/sdk/
* Virtual Earth Dev site: http://dev.live.com/virtualearth/
* Virtual Earth Tools for Visual Studio: http://dev.live.com/tools/ (This is an alternate way to use VE Maps in your ASP.Net app. It provides you with a server side VE Map control, which means that you can load it with data in your server side code).
* VE intellisense for Visual Studio 2008: http://www.codeplex.com/VEJS (This will make your life extremely easy to work with the VE map control, as it provides you with intellisense inside Visual Studio).

Popular Posts

Recent Posts

Unordered List

Text Widget