Posts

Donate

Search Text In Files Using Utility Software Agent Ransack

Image
Hello, Just sharing a utility software that's something useful for searching text(s) from a number of files called Agent Ransack . This has been useful to me lately since I've been working on data formatting/cleanup projects that involves number of files. The tool is free and available for download from this site Agent Ransack . Sample Usage

Bootstrap Table Add Table Footer For Total Amount

Image
To add a footer row to the Bootstrap Table by Wenzhixin, set the data-show-footer attribute of that table to true. <table id= "tblInvoiceReport" data-show-footer= "true" > Next is to set the data-footer-formatter of the Amount column using a JavaScript function. <th data-field= "Amount" data-searchable= "true" data-class= "tdDetails" data-footer-formatter= "TotalFormatter" >Amount</th> And here's the JavaScript function to compute the total amount. function TotalFormatter (items) { var totalPrice = 0; items.forEach( function (item) { totalPrice = parseFloat(totalPrice) + parseFloat(item.Amount.replace( '$' , '' ).replace( ',' , '' )); }); return '$' + parseFloat(totalPrice).toLocaleString( undefined , { minimumFractionDigits: 2, maximumFractionDigits: 2 }); }; Output

How To Perform Bulk Update Using SqlBulkCopy, C#.NET And SQL Server

Image
Good afternoon! Before I go into details, this post is solely based on the solution provided in this link Bulk Update In C# . The purpose of this tutorial is to provide step by step approach on how bulk update can be achieved using SqlBulkCopy, C#.NET And SQL Server. First is to create a simple table in your database that holds some fictitious records. USE [testdatabase] GO SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO CREATE TABLE [dbo].[Person]( [ID] [int] NOT NULL , [Name] [varchar](50) NULL , [Address] [varchar](50) NULL ) ON [ PRIMARY ] GO Database table with temp records Next is to create a console app that will perform the bulk update of records. The key to solving performance issues in updating records is to use a temporary table approach. class Program { static void Main( string [] args) { var listPerson = new List<Person> { new Person() {Id = 1001, Name = "James A." , Address = "US" }, new Person(

Extend Primary Partition With Unallocated Disk Space In Windows 10 Using MiniTool Partition Wizard

Good evening team! While I was doing an inventory of my Dell laptop's disk space, I found out that it has an unallocated size of around 70 GB and my C:\ primary drive is running out of space. My goal is to extend the C:\ drive with the unallocated space so that I can install more softwares and similar applications. My journey started with the Disk Management to extend the primary drive. Unfortunately, the Extend Volume feature is disabled. I started looking for answers in forums and tried some recommended free partition software to solve my case. But still no luck. After several hours of research, I finally extended my primary drive using a partition tool called MiniTool Partition Wizard . The tutorial to add extend a primary partition using unallocated space is presented here How to Merge Unallocated Space in Windows 10 for a Large Partition . Look for Case 2: Add Unallocated Space to Partition Windows 10 for the specific steps. Cheers!

How To Remove Duplicate Items In A List<T> Using IEqualityComparer<T>

Image
Good evening. Here's a simple demo on how to remove duplicate items in a List object using IEqualityComparer given that the generic list's type is complex. First we setup a simple model Employee class with Age, Name and Address properties. class Employee { public int Age { get ; set ; } public string Name { get ; set ; } public string Address { get ; set ; } } Next is to create a comparer class that implements IEqualityComparer interface. class EmployeeComparer : IEqualityComparer<Employee> { public bool Equals(Employee emp1, Employee emp2) { if (Object.ReferenceEquals(emp1, emp2)) return true ; if (Object.ReferenceEquals(emp1, null ) || Object.ReferenceEquals(emp2, null )) return false ; return (emp1.Age == emp2.Age) && (emp1.Name == emp2.Name) && (emp1.Address == emp2.Address); } public int GetHashCode(Employee obj) {

Generate Insert Data Scripts Without Identity Column In SQL Server

I have been generating insert data scripts through SQL Server Management Studio on the fly. However if you don't want to include the ID which is an identity column,this feature is not defined in the IDE. The workaround for this is to insert the records without the ID column into a temporary table and generate insert data scripts using that temp table. Select PartNum, PartDescription, Model, Category, SaleQTY, Price Into tmptblParts From tblParts The query above will insert records from tblParts to temp table tmptblParts. The column ID is omitted. After you have executed that statement, then generate insert scripts using tmptblParts.

Cannot Delete Rows From A Temporal History Table In SQL Server

Given that you'll have to delete records from an SQL server history table, you might come across with the issue as mentioned in the title of the post. After doing some research and experiments, there are three steps to delete records from a temporal history table. a. First is to remove the main table's System Versioning option. ALTER TABLE [dbo].[tblParts] SET ( SYSTEM_VERSIONING = OFF ) b. Next is to delete the records of the temporal history table. Delete from dbo.tblPartsHistory WITH (TABLOCKX); c. Then Set again the system versioning and history table of the main table. ALTER TABLE [dbo].[tblParts] SET ( SYSTEM_VERSIONING = ON (HISTORY_TABLE = [dbo].[tblPartsHistory])) Solved.. :-)

Microsoft Access - The 'Microsoft.ACE.OLEDB.12.0' Provider Is Not Registered On The Local Machine

Image
Hello, I was working on a project that reads an MS Access database using C# using OLEDB Provider. I already have downloaded and installed the Microsoft Access Database Engine 2010 Redistributable (AccessDatabaseEngine_X64.exe) from Microsoft since my OS is Windows 10 64bit. Upon running the project, I encountered the error as mentioned in the title of this post. I've tried several solutions and it didn't work for me. The only fix that worked is to change the Platform target of the project to "Any CPU" and unchecked the Prefer 32-bit checkbox . Cheers! :)

Bootstrap Table Get Or Retrieve All Table Data On CheckAll Event

Good evening fellow developers! Here's are solutions on how to obtain the Bootstrap-Table by Wenzhixin data if the check all event is fired. The first one loops through the table rows and then looks for the element in the row that holds the data either in the element attribute or innerText and retrieves it using jQuery methods. $( '#AttachmentsTable' ).on( 'check-all.bs.table' , function (e, rows) { var allrows = $( "#AttachmentsTable tr" ); downloadAttachmentsArray.length = 0 ; downloadAttachmentsArray = []; $.each(allrows, function (i, item) { if (i > 0 ) { var aElem = $(item).find( 'a' ).attr( 'file' ); downloadAttachmentsArray.push({ Filename : aElem }); } }); }); The better solution uses the built-in getData method of the bootstrap table which returns an array. And then you may then loop through that array to get the data. $( '#AttachmentsTable' ).o

Read Files From Google Photos Using Google Photos API, REST And VB.NET

Image
This is the VB.NET version of the post Read Files From Google Photos Using Google Photos API, REST and C#.NET . In your VB.NET project, you need to reference the Google.Apis.Auth package via NuGet and attach the JSON file that contains the Google API credentials. The models used for converting a JSON response to .NET object are shown below. Public Class clsResponseRootObject Public Property mediaItems As List( Of MediaItem) Public Property nextPageToken As String End Class Public Class MediaItem Public Property id As String Public Property productUrl As String Public Property baseUrl As String Public Property mimeType As String Public Property mediaMetadata As MediaMetadata Public Property filename As String End Class Public Class MediaMetadata Public Property creationTime As DateTime Public Property width As String Public Property height As String Public Property photo As Phot

Donate