Posts

Showing posts from July, 2019

Donate

Parse And Replace Element Attribute Value Of Script Template Using jQuery

Good afternoon fellow programmers! I recently have a task to load a Script template that contains HTML markup to a page dynamically. But before loading the template, I need to change the attribute values of certain elements such as id and name. However, reading the template object made it difficult for me to convert it to an HTML object so I can traverse and manipulate the DOM. After doing research and some experiments, I found the solution presented below on how to read the value of a Script template and be able to use jQuery methods to traverse and update the DOM elements. Sample Script Template To Load In A Page <script type= "text/html" id= "templateGroup" > <div name= 'divChildSkill_' class= "col-md-12" id= "divChildSkill_" > <div class= "col-md-12" > <div class= "col-md-6" > <div class= "col-md-4" > <label id= "anchorLabel" >&l

XmlDataProvider With TwoWay Binding In WPF

Hello, Here's a simple example of two-way binding in WPF using XMLDataProvider. This post is taken from John Papa's example in MSDN magazine years ago but with minor errors. The XMLDataProvider markup has color values and is declared inside Window.Resources node. <Window.Resources> <XmlDataProvider x:Key= "MoreColors" > <x:XData> <colors xmlns= '' > <color name= "pink" /> <color name= "white" /> <color name= "black" /> <color name= "cyan" /> <color name= "gray" /> <color name= "magenta" /> </colors> </x:XData> </XmlDataProvider> </Window.Resources> The Textbox control's Text Text property binding has been set to TwoWay so when you enter a color name it will be added as a ListBox Item. <Grid> <StackPanel> <TextBlock Width= "248" Height= "24"

Bootstrap Table Footer Data Footer Formatter Not Computing Correctly On Multiple Columns

Image
Good Afternoon! I recently faced a minor bug in Bootstrap Table by Wenzhixin using a single data-footer-formatter for four columns. I expected that this will compute the column values but the expected result shows that all columns total are zero. Bootstrap Table <table id= "tblBillingReport" class= "TableBorderCollapse table-striped " data-toggle= "table" data-search= "true" data-show-columns= "false" data-advanced-search= "false" data-id-table= "advancedTable" data-show-export= "true" data-toolbar= "#toolbar" data-click-to- select = "true" data-unique-id= "objectID" data-cookie= "true" data-show-footer= "true" data-height= "700" data-cookie-id-table= "tblBillingReportID" > <thead> <tr style= "background-color: #FFFFFF;" > <th dat

Export SQL Server Varbinary Or Blob To Disk Using C#

Image
Good evening Gents! I was given a task to export 100+GB of files from an MSSQL DB of which these files are saved in a table using Varbinary/Blob column. I've made some spike applications using BCP and .NET CLR but to no avail all the spike applications don't work since I don't have full permission to the database. The only solution that work for me was using the OLE Automation Procedures. So in order to export files from Blob, I'll present the steps below using AdventureWorks2012 database. 1. Enable OLE Automation Procedures by running script below. Use AdventureWorks2012 Go EXEC sp_configure 'show advanced options' , 1; GO RECONFIGURE; GO sp_configure 'Ole Automation Procedures' , 1; GO RECONFIGURE; GO 2. Run the stored procedure script below. The script will return the LargePhoto of a specific product. USE AdventureWorks2012 GO IF OBJECT_ID( 'SP_AdventureWorks_Export_Blob' , 'P' ) IS NOT NULL DROP PROCEDURE S

Donate