Microsoft SQL Insert Trigger to Get Current Datetime Value

This script gets the datetime value in this format MM/DD/YYYY:HR:MI:SSPM or AM. I could have used the CAST or CONVERT option but the did not reproduce the result that I wanted.  There are some option in CONVERT option but they converts into a 24hr format. Here is my trigger for insert event. USE dwdata GO /* —————————————————————————– www.myw0.com, Version 1.0, Creation Date: 11/05/2014 Functionality: Generate Datetime values into a text field —————————————————————————– */ if exists (select * from sysobjects…

Read More

Prevent Skype using port 80 and causing IIS to throw a HRESULT: 0x80070020 Exception

If you run NETSTAT -ano in the command prompt you should be able to see the process ids and its port been used. If you trace it back port 80 will be used by Skype Desktop. Option one: Closed completely Skype or  unchecking Tools > Options… > Advanced > Connection > “Use port 80 and 443 as alternatives for incoming connections Option 2: Go into IIS website bindings and change the IIS port to something different. I my case this…

Read More

The 25 Most Common Passwords

Here are the 25 most common passwords of 2013, along with the change in rank from last year. 1. 123456 (Up 1) 2. password (Down 1) 3. 12345678 (Unchanged) 4. qwerty (Up 1) 5. abc123 (Down 1) 6. 123456789 (New) 7. 111111 ( Up 2) 8. 1234567 (Up 5) 9. iloveyou (Up 2) 10. adobe123 (New) 11. 123123 (Up 5) 12. admin (New) 13. 1234567890 (New) 14. letmein (Down 7) 15. photoshop (New) 16. 1234 (New) 17. monkey (Down…

Read More

Pseudocode Standard Overview

Pseudocode is a kind of structured English for describing algorithms. It allows the designer to focus on the logic of the algorithm without being distracted by details of language syntax.  At the same time, the pseudocode needs to be complete.  It describe the entire logic of the algorithm so that implementation becomes a rote mechanical task of translating line by line into source code. In general the vocabulary used in the pseudocode should be the vocabulary of the problem…

Read More

Additional Math Functions in C#

Topic Overview Division in C# follows standard “integer division” rules when done with integer types. Many things are implicitly cast from narrow types to wider types. You can explicitly cast from one type to another by putting the type you want in parentheses in front (float a = (float)3.4948393;) Division by zero causes an exception to be thrown for integer types, and results in infinity for floating point types. NaN, PositiveInfinity, and NegativeInfinity are defined for the float and double types (float.NaN or Double.PositiveInfinity for example)….

Read More

Stop Google+ Users From Emailing You on Gmail

1. Sign into Gmail and Google+ using your universal login details. 2. Click on the gear icon in the top right corner, then click on “Settings.” 3. Find the “Email via Google+” option (ninth down from the top). 4. Next to the question of “Who can email you via your Google+ profile?” click the drop-down menu to choose: anyone on Google+, extended circles, circles, or no one. That is all! Image:

Read More

LINQ
 to 
SQL 
in 
C# – Cheat Sheet

LINQ
 to 
SQL
 in
 C# – Cheat
 Sheet Database context & database create var db = new MyDataContext(@”server=.\SQLEXPRESS;database=my;integrated security=SSPI”); if (!db.DatabaseExists()) db.CreateDatabase(); Select one Insert var only = db.Customers.SingleOrDefault(c => c.CustID == “CHIPS”); var first = db.Customers.FirstOrDefault(c => c.CustID == “CHIPS”); var customer = new Customer() { CustID = “CHIPS”, CompanyName = “Mr. Chips” }; db.Customers.InsertOnSubmit(customer); db.SubmitChanges();   – –  – – – – – – – – – – – – – – – – – – –…

Read More

Basic Math in C#

In a Nutshell Arithmetic in C# is very similar to virtually every other programming language out there, particularly C++, C, and Java. Addition works like this: int a = 3 + 4; Subtraction works like this: // int b = 7 – 2; Multiplication uses the asterisk character (‘*’) like this: //int c = 4 * 3; Division uses the forward slash character (‘/’) like this: int d = 21 / 7; The modulus operator (‘%’) gets the remainder of a…

Read More

Posted in Programming Comments Off on Basic Math in C#
Built-in C# Data Types

C# is a strongly-typed language. Before a value can be stored in a variable, the type of the variable must be specified, as in the following examples: int a = 1; string s = “Hello”; XmlDocument tempDocument = new XmlDocument();   Note that the type must be specified both for simple, built-in types such as an int, and for complex or custom types such as XmlDocument.   C# includes support for the following built-in data types: Data Type Range byte 0…

Read More