Pages

Remove Duplicate Record Form a Table in SQL


Use Partial Clause to remove duplicate records
delete from
(Select Colum1 , column2,

rownumber() over( partion by column1, column2

order by column1, Colum2
)Rowsnumbers
from DuplicatrecordTable) AliasTable

where AliasTable.Rowsnumbers>1

Reference:
sqlservercentral




Retrieve Distinct Rows of Table from Data View or Data Table


string[] str = new string[2];// string array is passed with column name of table
str[0] = "ColumnName1";
str[1] = "ColumnName2";
Datatable dt = //your tableobject
dt.DefaultView.ToTable(true, str);// return table of distinct rows


Avoid concurrent Execution of SP

Use sp_getapplock, sp_releaseapplock


EXECUTE sp_addmessage

@msgnum = 51001,

@severity = 16,

@msgtext = N'Resource NOT Available',

@lang = 'us_english',

@replace = REPLACE

Return to Top

CREATE PROCEDURE dbo.Employees_U_LastName

( @EmployeeID int,

@LastName varchar(20)

)

AS

BEGIN

SET TRANSACTION ISOLATION LEVEL REPEATABLE READ

BEGIN TRANSACTION

DECLARE @LockResult int

--sphelp sp_getapplock

EXECUTE @LockResult = sp_getapplock

@Resource = 'RepeatableRead_TRANSACTION',

@LockMode = 'Exclusive',

@LockTimeout = 0

IF @LockResult <> 0

BEGIN

ROLLBACK TRANSACTION

RAISERROR ( 51001, 16, 1 )

RETURN

END


-- All code between the use of sp_getapplock above,

-- and sp_releaseapplock below will be restricted to

-- only one user at a time.


-- Ten Second delay for Demonstration Purposes

WAITFOR DELAY '00:00:10'

-- Remove these three lines for 'Normal' use



UPDATE Employees

SET LastName = @LastName

WHERE EmployeeID = @EmployeeID

EXECUTE sp_releaseapplock

@Resource = 'RepeatableRead_TRANSACTION'

COMMIT TRANSACTION



END

Enterprise Libaray Overview

Microsoft Enterprise Libaray
  • It is collection of reusable sotware component(appln block) design to assist the software developer with common enterprising Development cross-cutting concern
  • Logging,validation,Data Access,exception Handling and so on
  • Application block are type of guidance;they provideed as source code ,test case,documentation tha can be used "as is,"extend ,or extended,or modified by the developer to use on complex enterprise level line of bussiness development projects
  • Enterprise libaray is used when buliding Application that are typically developed widely and interoperate with other application and system
  • Goals of Enterprise library
  • Consistency:All Enterprise library application block features cosistent design pattern and implementation approaches
  • Extensibility:All application block include define extensibility points that allow developer of the application block by adding theri own code
  • Ease of Use:Enterprise library offer numerous usability improvements,including graphical configuration tool,simpler installation procedures,clearer and more complete documentation and sample
  • Integration:Enterprise libaray application blocks are designed to work well together or individually
  • Reference:MSDN

Features of Asp.net 3.5

  • Asp.net Ajax is integerated in to dot netframwork
  • Asp.net Ajax control extender can be added to toolbox vs2008
  • Listview and datapager are new controls are added
  • New Data source control is added called as Linq DataSource
  • LINQ(language Integrated query) add native date query capapbilty to c#.net
  • WCF Support for RSS, JSON, POX and Partial Trust
  • Asp.net 3.5 include a new mergertool(aspnet_merge.exe).it comination and manage assemblies created by aspnet_compiler.exe(In older version it is avilable as addon)
  • new Assemblies 3.5
    1. System.core.dll-Includes the implementation for LINQ to objects
    2. System.data.linq.dll-Include the implementaion for LINQ to SQL
    3. System.Xml.Linq.dll-Include the implementation for LINQ to XMl
    4. System.Date.DatsetExtension.dll-Includes implementation for LINQ to DataSet
  • Asp.net 3.5 provide bettter support iis7 , iis7 Asp.net 3.5 modules and handles support unified configuration
  • vs2002 worked with asp.net 1.0,vs2003 worked with Asp.net 1.1 and vs2005 worked with Asp.net 2.0 and Vs2008 support multiTargetting i.e it works with Asp.net 2.0 and Asp.net 3.5

Framework

  • A set cooperating classes that make reusable Desingn to specfic application
  • A skeleton of an application in which developer plug in ther code and provides most of the commaon functionality
  • A framework is set of common and preferabicated software building block that programmer can be used extends or customise specfic computing solution
  • FrameWork is a skeleton of code for developing a particular type of an application.For example house it is treated as Framework it has predefine components like kitchen ,bedroom etc,futher it is used to build any type of house
  • Dot net Framework
    1. Framework class libaray (FCL):A series of classes with method that encapsulate common system or appication related functionality contained hundered classes avilable to application written to utilize .net language (c#.net...)
    2. .net Runtime Host:it is "sandbox" or "protective bubble" where your application run.manage permission granted to application run .provide a common system of data types accross all .net languages and manages memory for application
    3. Utilies(compiler,code genertor, etc) variours and sundary application that perform a wide variety of task.
  • Note:Design pattern refers to repeatable solution to particular for common occuring software problem.it is solution to particular problem.RelationShip between framework and desiogn pattern is the framwork is made by using one or more design pattern

HTML 5.0 SUPPORTED AND UNSUPPORTED TAGS

  • New Html 5.0 tags
  • <article>-Define an article
  • <aside>-Define content aside from page contents
  • <audio>-Define Sound Content
  • <command>-Define command button,like radio button,a checkbox,a button
  • <datagrid>-Define a data in tree list
  • <datalist>-Define a Dropdownlist
  • <datatemplate>-Define a data template
  • <dialog>-Define a dialog(conversion)
  • <embed>-Define a external interactive contents or plugin
  • <eventsource>-Define a target for event sent by server
  • <figure>-Define a group of media content, and their caption
  • <footer>-Define a footer for a section or page
  • <Header>-Define a header for a section of page
  • <section>-Define a section
  • <source>-Define a media source
  • <time>-Define a date/time
  • <video>-Define video
  • Unsupported tag of Html 5.0 <acronym>,<applet>,<basefont><big> ,<center>,<dir>,<frame>,<frameset> ,<isindex>,<noframes>,<s>,<strike> ,<tt>,<u>,<xmp>
  • Referefnce:W3schools