DECLARE @TableName VARCHAR(255) DECLARE @sql NVARCHAR(500) DECLARE @fillfactor INT SET @fillfactor = 80 DECLARE TableCursor CURSOR FOR SELECT OBJECT_SCHEMA_NAME([object_id])+'.'+name AS TableName FROM sys.tables OPEN TableCursor FETCH NEXT FROM TableCursor INTO @TableName WHILE @@FETCH_STATUS = 0 BEGIN SET @sql = 'ALTER INDEX ALL ON ' + @TableName + ' REBUILD WITH (FILLFACTOR = ' + CONVERT(VARCHAR(3),@fillfactor) + ')' EXEC (@sql) FETCH NEXT FROM TableCursor INTO @TableName END CLOSE TableCursor DEALLOCATE TableCursor GO
Exclude property of Class Object from Serialization Json.NET has the ability to conditionally serialize properties by placing a ShouldSerialize method on a class. This functionality is similar to the XmlSerializer ShouldSerialize feature. ShouldSerialize To conditionally serialize a property, add a method that returns boolean with the same name as the property and then prefix the method name with ShouldSerialize. The result of the method determines whether the property is serialized. If the method returns true then the property will be serialized, if it returns false then the property will be skipped. Live Code We need to exclude hsn and Doc_issue when they are nothing in runtime (Same is done Nothing when not to be Serialized) Public Structure Json_Parent Public Property gstin As String Public Property fp As String Public P...
Get Max and Min from Array Dim data() As Int16 = {1, 2, 3, 5, 6, 7, 3} Dim C As Integer = data.Max() Dim D As Integer = data.Min() Distinct of Array Dim data() As Int16 = {1, 2, 3, 5, 6, 7, 3} Dim M() As Int16 = data.Distinct().ToArray() Sum With Array Dim data() As Int16 = {1, 2, 3} Dim X As Int32 = data.Sum(Function(y) y) ' This will Return 6
Comments
Post a Comment