It requires to get group by with sum. var amount = plod.objProduct.Where(i => i.SID == nslres.SID).GroupBy(s => s.SID).Select(x => new { Totamt = x.Sum(y => y.PrdPrice) }).FirstOrDefault().Totamt; …
case when statement for order by clause in sql server
It is great feature where can when can be used in order by clause in sql server , below is the query where at the time of creation record modified date will be null and creation date will be present date time, but at the time of update modified date will be updated, now using…
New feature in sql server 2012
Lots of New feature has been introduced with sql server 20012, it is the latest version from Microsoft after sql server 2008 r2. Below are some features …. 1)Sequence : this feature is already with oracle and post gre sql, but microsoft has introduced with 2012 version, under programmability , sequence can be found, it…
Advantages of Entity Framework
Entity frame work has several advantages like below 1)Orm supprt: It is based on object relational mapping support,which maps between object and data storage 2)Rapid development: by using entity frame work ,rapid application development can be done by using data base first approach. 3)Full support for Relational database , with relational key. 4)It work with…
Advantages of Razor View Engine
From Mvc 2.0 there is only aspx view engine which supports only aspx web form syntax . But from MVC 3.0 new view engine introduced Razor view engine .Feature of razor view engine 1)It is Test driven development support 2)It uses Unit testing only , this is the best advantages , not view engine does…
Page life cycle of MVC
Page life cycle of MVC is like below .When Browser request to application it will do first 1)App initialization: It will create initialization of Application of IIS 2)Routing: It is very important of MVC , this is the first step , all mvc based application starts with routing,it passes UrlRoutingModule , the route table contains all…
For Using sp_executesql with param definition and output parameter
If anyone wants to output value with param definition , by below it can be done. SET @SQLString = N’SELECT @UserIDOUT = ‘ + @ModifiedByColumn + ‘ FROM #ins’; SET @ParmDefinition = N’@UserIDOUT NVARCHAR(100) OUTPUT’; EXECUTE sp_executesql @SQLString, @ParmDefinition, @UserIDOUT=@USERID OUTPUT;…
AuditLog Trigger
For creating audit log this trigger can be used to fire trigger USE [PCCAS] GO /****** Object: Trigger [dbo].[Crime_AuditLog] Script Date: 04/29/2014 18:36:02 ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO ALTER TRIGGER [dbo].[Crime_AuditLog] ON [dbo].[crime] FOR INSERT, UPDATE, DELETE AS BEGIN TRY BEGIN DECLARE @bit int, @FIELD int, @maxfield int, @CHAR int, @fieldname…
- ← Previous
- 1
- …
- 7
- 8
- 9
- Next →