Posts

Showing posts with the label GUID

Donate

Check If T-SQL Field Value Is A UniqueIndentifier In Select Case Statement

In the event that you need to check a T-SQL field value if it's a GUID or UniqueIdentifier, the same procedure is used in applying the logic in a where clause. SELECT CartObjectID, CartName, CartQuantity, CASE When TDD.FieldData like REPLACE ( '00000000-0000-0000-0000-000000000000' , '0' , '[0-9a-fA-F]' ) Then ( Select CartValue From tblCartList where ListID = TDD.FieldData ) ELSE TDD.FieldData END As FieldData

Pass GUID As Parameter To Action Using ASP.NET MVC ContribGrid

Hi, In a scenario where in you want to pass a GUID object to an Action Parameter, the parameter might contain a null value. Since Guid is not nullable, you can't simply just pass it to an action parameter because Action parameters require nullable and reference types. You might encounter an error like this: An optional parameter must be a reference type, a nullable type, or be declared as an optional parameter Assuming you have an aspx view below: <div> <% Html.Grid(Model).Columns (c => { c.For(m => m.Price); c.For(m => m.ProductName); c.For(m => m.ProductID); c.For( "View Person" ).Named( "" ).Action(m => { %> <td> <%= Html.ActionLink( "View Person" , "ProductDetail" , "Home" , new { @id = m.ProductID.ToString() }) %> </td> <% }); %> <% }).Render(); %> </div> and an action

Donate