Jasinski Technical Wiki

Navigation

Home Page
Index
All Pages

Quick Search
»
Advanced Search »

Contributor Links

Create a new Page
Administration
File Management
Login/Logout
Your Profile

Other Wiki Sections

Software

PoweredBy

Search Engine

Here you can search through the pages of this Namespace, their attachments and the files uploaded to the system.
Note: the results will only display the items you have permissions to read.



Filter by Category
























































This search, performed through 3.54 MB (620 documents, 13928 words), completed in 0.0 seconds and yielded 30 results.

Home Page — 6.2%

[...] SQL Server Support Views, including DbLayout , FKeys , TableRowCounts , and CodeObjects . Index function toggleVisibility(srcId) { var src = document.getElementById(srcId); var tgtId = 'TGT_' + srcId.substring(4); var tgt = document.getElementById(tgtId); var img; if (tgt == null) alert('tgt is null:' + tgtId); else if (tgt.style == null) alert('style is null'); else if (tgt.style.display == null) alert('display is null'); else if (tgt.style.display == "none") { img = "public/upload/images/Minus.png"; src.src [...]

Index — 5.6%

function toggleVisibility(srcId) { var src = document.getElementById(srcId); var tgtId = 'TGT_' + srcId.substring(4); var tgt = document.getElementById(tgtId); var img; if (tgt == null) alert('tgt is null:' + tgtId); else if (tgt.style == null) alert('style is null'); else if (tgt.style.display == null) alert('display is null'); else if (tgt.style.display == "none") { img = "public/upload/images/Minus.png"; src.src = img; tgt.style.display = "table-row"; } else { img = "public/upload/images/Plus.png"; src.src [...]

Add Audit Fields to Every Table - SQL Server — 3.0%

[...] '*/' from MyTables where Name not in (select o.name from sys.objects o inner join sys.columns c on o.object_id = c.object_id where o.type = 'U' and c.name=@CreatedByField) or Name not in (select o.name from sys.objects o inner join sys.columns c on o.object_id = c.object_id where o.type = 'U' and c.name=@CreatedOnField) or Name not in (select o.name from sys.objects o inner join [...]

Lookup Class - ASP.NET — 2.1%

[...] Lookup(Of EnumType) Protected _dict As Dictionary(Of EnumType, String) Protected MustOverride Function LookupValue(ByVal key As EnumType) As String Protected MustOverride Sub SetValue(ByVal key As EnumType, ByVal newValue As String) '---------------------------------------------------------------------------------------------- [...]

Common Functions - SQL Server Reporting Services — 2.1%

[...] selected DisplayParameters — displays the values of multiple parameters Using the Functions Each function has its source code shown below. To use the function in a report, you would copy the source code into each report where needed. In Visual Studio 2005, you do this by navigating to the Report menu > Report Properties > Code tab and pasting your code there. Report Properties dialog, Code tab DateRange The following function returns one of the following, depending on which date(s) are NULL. (not specified) [...]

An Extensive Examination of the DataGrid Web Control - ASP.NET — 1.9%

[...] the Font we have to use a hyphen (-). This is synonymous to the "dot" in languages like VB.NET and C# when referencing an object's property. <asp:DataGrid runat="server" id="dgFAQs" BackColor="#eeeeee" Width="85%" HorizontalAlign="Center" Font-Bold="True" Font-Name="Verdana" Font-Size="10pt" /> DataGrid Styles The DataGrid Web control contains a number of "styles" that you will find quite useful in customizing the look and feel of the DataGrid. There are four available styles in DataGrids: HeaderStyle - Specifies [...]

Database Layout - SQL Server — 1.8%

[...] default values and description for each column, where defined. Note that the fn_listextendedproperty function, used for the ColumnDesc column, requires a database compatibility level of at least 90. /*================================================================================================== [...]

Schema Differences Between Databases - SQL Server — 1.7%

[...] DatabaseName = db_name() ,SchemaName = s.name ,TableName = o.name ,ColumnName = c.name ,DataType = case when t.name in ('char','text','varchar') then t.name + '(' + convert(varchar,c.max_length) + ')' when t.name in ('nchar','ntext','nvarchar') then t.name + '(' + convert(varchar,c.max_length/2) + ')' when t.name in ('decimal','numeric','real') then t.name + '(' + convert(varchar,

Quick Reference - jqGrid — 1.5%

[...] /*===============================================================================================*/ $(document).ready(function () { loadUserGrid(); }); /*===============================================================================================*/

Angular Walkthrough — 1.3%

[...] var myAngularApp = angular.module("myAngularApp", ["ngResource", "ngRoute"]). config(function ($routeProvider) { $routeProvider .when('/Team', { controller: 'TeamDashboardController', templateUrl: 'Views/Angular/TeamDashboard.html' }) .otherwise({ redirectTo: '/Team' }); }); 4. Create the /Views/Shared/_Layout.cshtml file with the following code. The key items are the ng-app attribute on the body tag, and the script references to angular.min.js and app.js . @{ Layout = null; } <html> [...]

Data Migration without SSIS — 1.3%

[...] view [dbo].[ColumnsExt] as with SysTgtColumns as ( select TblName = t.name ,ColName = c.name ,SchemaName = s.name ,ColId = c.column_id ,ColIsIdentity = convert(int, c.is_identity) from dbo.TargetTables t inner join dbo.TargetColumns c on t.object_id = c.object_id inner join dbo.TargetSchemas s on t.schema_id = s.schema_id ) ,a as ( select d.DbId ,d.DbName ,DbSourceId = d.SourceId ,t.TblId ,t.TblName ,TblSourceId = [...]

Namespacing in JavaScript — 1.2%

[...] true, browser: true, immed: true, passfail: true, undef: true, newcap: true*/ var Contract = (function () { ///<summary> class Contract </summary> /// <returns type="Contract" /> function ContractError(message, fileName, lineNumber) { ///<summary> class ContractError </summary> /// <param name="message" type="String"> args </param> /// <param name="fileName" type="String"> args </param> /// <param name="lineNumber" type="Number"> [...]

Database Dependencies - SQL Server — 1.2%

[...] = convert(sysname, p.type) ,Id = convert(int, p.id) ,ChildName = convert(sysname, c.name) ,ChildType = convert(sysname, c.type) ,ChildId = convert(int, c.id) ,Lvl = convert(int, c.lvl+1) ,NamePath = convert(varchar(8000),p.name + '\' + c.Lineage) from sysobjects p inner join sysdepends d on p.id = d.depid inner join objects c on c.id [...]

GridViewExtender Class - ASP.NET — 1.2%

[...] </Columns> </asp:GridView> <asp:Button runat="server" ID="uxAddNewButton" Text="Add New" /> Declare a Private Variable C# private GridViewExtender _gridViewExt; Visual Basic Private _gridViewExt as GridViewExtender Write Callback Function to Retrieve Data This will be the Requery Handler procedure used when you instantiate the GridViewExtender class. Its purpose is to retrieve data to be displayed in the grid. Make sure you use the function signature shown in the example. C# private DataTable QueryData() { [...]

Database Mirroring Setup - SQL Server — 1.2%

[...] into) each of the database servers. 6. The following procedure requires that each server has the folder C:\SQLMIRROR . Procedure Notes 1. Server Names should be the public DNS name: for example, ec2-100-100-100-100.compute-1.amazonaws.com 2. Server Normalized Names should be the Server Name with all punctuation changed to underscores: for example, ec2_100_100_100_100_compute_1_amazonaws_com Procedure 1. Create database master key, certificate, and endpoint on each server Principal Server use master GO /* If there is not already a DATABASE MASTER KEY in the master [...]

ActiveDirectoryQuery Class — 1.1%

[...] if (results.Count == 1) { System.DirectoryServices.PropertyCollection c = results[0].GetDirectoryEntry().Properties; uxNameLabel.Text = ToString(c["cn"].Value); uxPhoneNumberLabel.Text = ToString(c["telephoneNumber"].Value); uxEmailAddressLabel.Text = ToString(c["mail"].Value); uxSearchResultsBindingSource.DataSource = null; } else { uxNameLabel.Text [...]

Cascading DropDownLists - jQuery — 1.0%

[...] '---------------------------------------------------------------------------------------------- Protected Function DropDownHtml(ByVal sourceTable As DataTable, ByVal textField As _ String, ByVal valueField As String) As String Dim result As String = "" result &= DropDownItemHtml("--Select One--", "", _selectedValue) For Each row As DataRow In sourceTable.Rows result &= DropDownItemHtml(row.Item(textField).ToString(), _ row.Item(valueField).ToString(), _ _selectedValue) [...]

Column Definitions for Stored Procedure Result Set — 1.0%

[...] [MyDatabase].[MySchema].[sp_MyStoredProc] 0,0,null') SELECT c.name ,[type] = t.name ,c.max_length ,c.[precision] ,c.scale ,c.is_nullable FROM tempdb.sys.columns AS c inner JOIN tempdb.sys.types AS t ON c.system_type_id = t.system_type_id AND c.user_type_id = t.user_type_id WHERE [...]

Cascading Style Sheets Reference — 1.0%

[...] element from which all visible elements descend. In HTML documents, the ' BODY ' element can serve this function: BODY { color: black; background: url(texture.gif) white; } This will work even if the author has omitted the ' BODY ' tag (which is legal) since the HTML parser will infer the missing tag. The example above sets the text color to be black and the background to be an image. The background will be white if the image is not available. (See section 5.3 for more on this.) Some style properties are not inherited from the parent element to the child element. [...]

Generating XML from Recursive, Hierarchical Data — 1.0%

[...] FK_Attributes_Elements FOREIGN KEY(ElementId) REFERENCES dbo.Elements (ElementId) Helper Code The DBO.PadLeft() function ALTER function [dbo].[PadLeft] ( @inputValue int ,@width int ) returns varchar(max) as begin return substring( replicate('0', @width) + convert(varchar(max), @inputValue) ,len(convert(varchar(max), @inputValue)) + 1 ,@width ) end Displaying the Hierarchy declare @RootElementId int, @IdWidth int set @RootElementId = 1 set @IdWidth = 10 ; WITH MyElements as [...]

Useful Windows Registry Keys — 0.9%

[...] This is the preferred method of changing these entries. Registry Entry Sample Value AppData C:\WINNT\Profiles\pgj01\Application Data Cache C:\WINNT\Profiles\pgj01\Temporary Internet Files Cookies C:\WINNT\Profiles\pgj01\Cookies Desktop C:\WINNT\Profiles\pgj01\Desktop Favorites C:\WINNT\Profiles\pgj01\Start [...]

Membership API with Windows Authentication and a Custom Role Provider - ASP.NET — 0.9%

[...] MyNamespace Public Class RoleProvider Inherits System.Web.Security.RoleProvider Public Overrides Function GetRolesForUser(ByVal username As String) As String() ' TODO: Implement this method Dim result As String() = {} Return result End Function ' These remaining methods are necessary because they are declared MustInherit in the base class. Public Overrides Sub AddUsersToRoles(ByVal usernames() As String, ByVal roleNames() As String) End Sub Public Overrides Property ApplicationName() [...]

AJAX Example - jQuery and JavaScript — 0.9%

[...] async: { false | true } , datatype: 'json', data: { param1: value1, param2: value2 }, success: function(data) { $.each(data, function(key, val) { // do something with each value }); /* each */ }, /* success */ error: function(xhr, ajaxOptions, statusDescription) { alert(statusDescription); } /* error */ }); /* ajax */ With the exception of the async parameter, the most common parameters can be remembered via the mnemonic device "dusted". D = data U = url S = success [...]

Modal Dialogs - JavaScript — 0.8%

[...] be in the same directory. When the Click Me button is clicked, the dialog appears. The sm JavaScript function has the following parameters p1 = ID of the DIV for the "dialog" p2 = "dialog" width (pixels) p3 = "dialog" height (pixels) <html> <head> <!-- The JavaScript and CSS files are expected to be in the same directory as the HTML file. --> <script type="text/javascript" src="modaldbox.js"></script> <link rel="stylesheet" href="modaldbox.css" type="text/css" /> </head> <body> [...]

Data Migration without SSIS (for a single table) - SQL Server — 0.8%

[...] sys.objects o inner join sys.schemas s on o.schema_id = s.schema_id inner join sys.columns c on o.object_id = c.object_id where 1=1 and c.is_identity = 1 and '[' + s.name + '].[' + o.name + ']' = @tableName ) set @hasIdentityColumn = 1 if @hasIdentityColumn = 1 set @sql = @sql + 'select n = 1, sql = ''set identity_insert ' + @tableName + ' on''' + char(13) select @sql = @sql + 'union select n = 2, sql = ''insert [...]

GridViewRowExtender Class — 0.8%

[...] GridViewRow Public Sub New(ByVal gvRow As GridViewRow) _gvRow = gvRow End Sub Public Function GetText(ByVal textBoxId As String) As String Return CType(_gvRow.FindControl(textBoxId), TextBox).Text End Function Public Function GetText(Of T)(ByVal textBoxId As String) As T Dim s As String = GetText(textBoxId) Dim result As T If Not TryParse(Of T)(s, result) Then result = Nothing End If Return result End Function [...]

Angular Notes — 0.7%

[...] routes define which controller is used to respond to the request. App.config(['$routeProvider', function($routes) { $route.when('/',{ templateUrl : '/templates/home.html', controller : HomeCtrl }); $route.when('/register',{ templateUrl : '/templates/register.html', controller : RegisterCtrl }); $routes.otherwise({ redirectTo : '/' }); }]); Controllers and Scope Coding a Controller var SomeCtrl = function($scope, $http, $location) { $scope.value [...]

Date Validation - JavaScript — 0.7%

[...] date character, minimum year and maximum year var dtCh= "/"; var minYear=1900; var maxYear=2100; function isInteger(s){ var i; for (i = 0; i < s.length; i++){ // Check that current character is number. var c = s.charAt(i); if ((c < "0") || (c > "9")) return false; } // All characters are numbers. return true; } function stripCharsInBag(s, bag){ var i; var returnString = ""; [...]

WorkDay Function - SQL Server — 0.6%

This function reproduces the Excel WORKDAY() function, which adds a number of business days to a given date. For a C# version of this function, see AddBusinessDays Function - C# . /*-------------------------------------------------------------------------------- Credits: [...]

Using the XML Data Type - SQL Server — 0.6%

[...] AllocationPct --------------------------------------------------------------------------------*/ ;with InputDataSet as ( select RplProjectResourceRoleId = T.c.value('RplProjectResourceRoleId[1]','int'), AmcYear = T.c.value('AmcYear[1]','int'), AmcMonth = T.c.value('AmcMonth[1]','int'), AllocationPct = T.c.value('AllocationPct[1]','decimal(8,2)') from @dataSet.nodes('/NewDataSet/PlannedAllocation') T(c) ) update [...]

ScrewTurn Wiki version 3.0.1.400. Some of the icons created by FamFamFam. Except where noted, all contents Copyright © 1999-2023, Patrick Jasinski.