Creating an OData Service for a SQL Server Database

To create an OData service for a SQL Server database, we will create a new Visual Studio ASP.NET web application: Select Empty template and check Web API: This will create: Now, add the OData NuGet packages: Add Entity Framework: Next, add a new item: Select EF Designer from database: Select the database connection, click new connection if required, and click Next. We will connect to an Azure SQL database with … Continue reading Creating an OData Service for a SQL Server Database

Creating an Azure SQL Server Database

To create an Azure SQL Database, go to portal.azure.com and select New->Databases->SQL Database: Enter a name and select the source. You can select: Blank database Sample (AdventureWorksLT) Backup We will select Sample (AdventureWorksLT): Select to create a new server: Enter the server name and enter a login name and credentials: Click to select the type of SQL Server. Select the DTUs: Click Apply and Create. Once the server has been … Continue reading Creating an Azure SQL Server Database

JavaScript – Calling Functions

Let’s go through an example of different ways to call a function in JavaScript. Let’s say we have a function that prints Hello World to the console. We can call this as: function HelloWorld() { console.log(“Hello World”); } HelloWorld(); This function can also be assigned an anonymous variable and called as below: var i = function() { console.log(“Hello World”); } i(); Or also run immediately as: var i = function() … Continue reading JavaScript – Calling Functions

JavaScript – Use Strict

“use strict” is a feature of JavaScript that tells the compiler to use a strict context. For example, consider the code below. This code produces no errors, and displays “1” in the console: However, let’s say we didn’t include “var” before our variable. In normal JavaScript without using “use strict”, this would be fine. However, with “use strict”, it throws an error: For more information: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Strict_mode  

JavaScript Resources

Libraries Angular React Node Vue Redux jQuery Ember Meteor Visualizations GoJS D3 Leaflet  

JavaScript – Object defineProperty

In JavaScript, there are different ways to define properties to objects. For example, if we have a Customer class, we can define properties using the this keyword, and also Object.defineproperty: function Customer (firstname, lastname, email, phonenumber) { this.firstname = firstname, this.lastname = lastname, this.email = email, Object.defineProperty(this, “phonenumber”, { writable: true, enumerable: true, configurable: false, value: phonenumber }); } //Print out Customer var Customer00001 = new Customer(“Bob”, “Smith”, “bob@test.com”, “111-222-7777”) … Continue reading JavaScript – Object defineProperty

How to Change the Company Logo in Dynamics AX

The company logo in Dynamics AX is used in different areas such as reporting. To change the company logo, go to the Organizational administration page and select Legal Entities. Then, select the legal entity that you would like to add or change a logo, and click “Company Logo”: Click Change or Remove to add/remove a logo:  

Installing Microsoft SQL Server AdventureWorks Sample Data

Microsoft provides sample SQL Server databases called AdventureWorks. You can download the files from the CodePlex website for your relevant SQL Server version here – http://msftdbprodsamples.codeplex.com/.  You can then attach the databases to your SQL Server instance. To do this, copy the files to a location on the SQL Server and run the following command: CREATE DATABASE [AdventureWorks2012] ON (FILENAME = N’C:\Program Files\Microsoft SQL Server\MSSQL11.MSSQLSERVER\MSSQL\DATA\AdventureWorks2012_Data.mdf’) FOR ATTACH_REBUILD_LOG GO CREATE DATABASE [AdventureWorksDW2012] ON (FILENAME … Continue reading Installing Microsoft SQL Server AdventureWorks Sample Data

JavaScript Object Literals

Object literals are a way to define objects in JavaScript using comma-separated name-value pairs of properties and methods. For example, we can define a Customer object with the syntax, which contains properties and a method GetCustomer(): var Customer = { firstname: “Bob”, lastname: “Smith”, email: “bsmith@test.com”, phonenumber: “555-111-2222”, GetCustomer: function() { return this.firstname + ‘ ‘ + this.lastname + ‘ ‘ + this.email + ‘ ‘ + this.phonenumber; } } … Continue reading JavaScript Object Literals

C# – Inheritance

Carrying on from our previous transport post, we currently have a car class that has some properties. However, a car is a type of vehicle. What if we wanted to expand to other types of vehicles in our solution? Let’s add a vehicle class. using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Transportation {     class Vehicle     {     } } Now, as we shoudn’t create an object out of “vehicle”, we will define this as an abstract class: using System; using System.Collections.Generic; using System.Linq; … Continue reading C# – Inheritance