Free Microsoft .NET Development Resources

CSharp

  • CSharp School First Edition: The Programmer’s Heaven C# School book covers the .NET framework and the C# language. Starting with the basics of the language, it goes on to cover object oriented programming techniques and a wide range of C# languages features including interfaces, exceptions and delegates. Later chapters cover practical topics including database access with ADO.NET, building Windows forms applications, multi-threading and asynchronous I/O. The final chapter covers new features in C# 2.0, including generics.
  • Threading in C#: C# supports parallel execution of code through multithreading. A thread is an independent execution path, able to run simultaneously with other threads.
  • Mike’s C# Coding Style Guide: A 13 page C# Coding Style guide. Again, the focus is on Casing, Naming conventions, Declaration style etc. A short and simple Style Guide.
  • Encodo C# Handbook: Encodo C# handbook is 72 pages of guidelines on Structure, Formatting, Naming. It also has a ‘Patterns and Best Practices’ section, which is a must read for any .NET/C# developer.
  • C# Coding Standards: A set of coding guidelines for C# 3.0 and C# 4.0, design principles, layout rules, FxCop rulesets and (upcoming) custom FxCop and StyleCop rules for improving the overall quality of your code development.

Patterns and Practices

  • Developer’s Guide to Microsoft Prism: Prism provides guidance designed to help you more easily design and build rich, flexible, and easy to maintain Windows Presentation Foundation (WPF) desktop applications and Silverlight Rich Internet Applications (RIAs) and Windows Phone 7 applications. Using design patterns that embody important architectural design principles, such as separation of concerns and loose coupling, Prism helps you to design and build applications using loosely coupled components that can evolve independently but which can be easily and seamlessly integrated into the overall application. Such applications are often referred to as composite applications.
  • Windows Phone 7 Developer Guide: This guide describes a scenario around a fictitious company named Tailspin that has decided to encompass Windows Phone 7 as a client device for their existing cloud-based application. Their Windows Azure-based application named Surveys is described in detail in a previous book in this series, Developing Applications for the Cloud on the Microsoft Windows Azure Platform.
  • Developing Application for SharePoint 2010: SharePoint 2010 introduces rich new areas of functionality that create more choices and fresh opportunities for developers and solution architects. Sandboxed solutions, new options for data modeling and data access, and new client programming models with Silverlight and Ajax integration offer a step change in what you can accomplish with SharePoint applications. This guidance provides a deep technical insight into the key concepts and issues for SharePoint 2010 solution developers.
  • Web Service Software Factory 2010: The Web Service Software Factory 2010 (also known as the Service Factory) is an integrated collection of resources designed to help you quickly and consistently build Web services that adhere to well-known architecture and design patterns. These resources consist of patterns and architecture topics in the form of written guidance and models with code generation in the form of tools integrated with Visual Studio 2010.
  • Web Client Software Factory 2010: Architects and developers can use the Web Client Software Factory to quickly incorporate many of the proven practices and patterns of building Web client applications. These practices and patterns have been identified during the development of many Web client applications and their components. This version has been updated to work with Visual Studio 2010.
  • Enterprise Library 5.0: This major release is focused on architectural refactoring and full support of DI-style of development, improved usability, .NET Framework 4.0 and Visual Studio 2010 compatibility. Also, many compelling improvements were made to the existing application blocks to incorporate customer feedback and to dramatically improve testability, maintainability, and usability (including an all new configuration tool and Developer’s Guide). A migration guide is also provided.
  • A Guide to Claims–based Identity and Access Control: This book gives you enough information to evaluate claims-based identity as a possible option when you’re planning a new application or making changes to an existing one. It is intended for any architect, developer, or information technology (IT) professional who designs, builds, or operates Web applications and services that require identity information about their users.

Performance

  • Improving .NET Application Performance and Scalability: This guide provides end-to-end guidance for managing performance and scalability throughout your application life cycle to reduce risk and lower total cost of ownership. It provides a framework that organizes performance into a handful of prioritized categories where your choices heavily impact performance and scalability success. The logical units of the framework help integrate performance throughout your application life cycle. Information is segmented by roles, including architects, developers, testers, and administrators, to make it more relevant and actionable. This guide provides processes and actionable steps for modeling performance, measuring, testing, and tuning your applications. Expert guidance is also provided for improving the performance of managed code, ASP.NET, Enterprise Services, Web services, remoting, ADO.NET, XML, and SQL Server.

Security

  • Microsoft Security Development Lifecycle (SDL) – Version 4.1a: As part of its commitment to a more secure and trustworthy computing ecosystem, Microsoft makes its Security Development Lifecycle (SDL) process guidance available to the public. The Microsoft SDL process guidance illustrates the way Microsoft applies the SDL to its products and technologies. The version 4.1a of the SDL Process Guidance includes SDL for Agile Development. IT policy makers and software development organizations can leverage this content to enhance and inform their own software security and privacy assurance programs.
  • Building Secure ASP .NET Applications: Guidelines for authentication, authorization and secure communication across the tiers. Topics include ASP.NET, Enterprise Services (COM+), Web Services, Remoting, and data access (including ADO.NET and SQL Server).

MSDN Magazine

Code Samples

  • Microsoft All-In-One Code Framework: A free, centralized code sample library driven by developers’ needs. Our goal is to provide typical code samples for all Microsoft development technologies, and reduce developers’ efforts in solving typical programming tasks.
  • Head First Design Patterns: This project consists of ported code examples from the book Head First Design Patterns by Eric and Elizabeth Freeman into C#. (VB version)

Pluralsight Teams Up With DreamSpark And Offers Free 90 Day On-Demand Training

I must say that the fine folks over at Pluralsight continue to share their outstanding training content in a fashion that opens doors up to many either in the development community or those currently in school.

It never ceases to amaze me just how much the Pluralsight community believes in what they are doing and if I may say so they do an outstanding job! Most recently Pluralsight has teamed up with DreamSpark where all worldwide verified DreamSpark members can obtain a 90-day Pluralsight On-Demand subscription. Not bad at all and you if have never attended one of their course you are in for a surprise. The technical staff is some of the best folks in the industry and they do an exceptional job at education. The following is just a handful of the extensive library that they have to offer.

  1. CLR Fundamentals
  2. ASP.NET MVC Advanced Topics
  3. LINQ Architecture
  4. Introduction to OData
  5. SharePoint 2010 Development

So if you’re a student and have a DreamSpark account and if you don’t have an account create one today and don’t miss out on this wonderful opportunity provided by Pluralsight and DreamSpark.

computer training

Is Facebook’s Facial Recognition Going Too Far?

digital faceThe facial recognition feature is technology you may take for granted when you upload images on Facebook.

The point of view that I take is technology is only as good as those that use it. What am I saying you may ask? All technology has good and bad points and the individual behind the use of the technology makes the difference. For example, just because I have the freedom to publish my thoughts that does not give me the right to do so should it cause harm to another. Using common sense should always be the focal point and as technology rapidly changes it is more important that ever that you understand the services you’re using.

If you’re concerned with you face being tagged then you will want to pay close attention. According to Facebook, for any reason you don’t want your name to be suggested, you will be able to disable suggested tags in your Privacy Settings.  Just click ‘Customize Settings’ and ‘Suggest photos of me to friends.’ Your name will no longer be suggested in photo tags, though friends can still tag you manually.”

Currently, you have the option of untagging photos you’ve been tagged in by friends. To accomplish this just go to the photo and click your name. There is no sure fire way to prevent friends from tagging you in photos, but you can prevent others from seeing the photos via your tagged name.

  • From the Account menu in the upper right corner of your profile, chose Privacy Settings.
  • Underneath the list of your current privacy settings, click “Customize settings.”
  • Scroll down to “Things others share” section.
  • Next to “Photos and videos I’m tagged in” click “Edit settings.”
  • From the “Edit settings” prompt that appears on your screen, use the drop-down menu to choose “Customize.”
  • In the “Custom Privacy” prompt that appears, you will see a drop down menu next to “These people.”
  • From the “These people” menu, you have the option of choosing who can see photos via your tagged name. You can set it to “Only me” or you can add specific Facebook friends who are permitted see those photos via your tagged name. Here, you also have the option of preventing specific Facebook friends seeing photos via your tagged name.
  • Save this option. As with other Facebook privacy settings, you can change it at any time. You just have to do it.

http://www.youtube.com/watch?v=5kHGsKnf3_I

I personally have seen a great deal of conversation concerning Facebook’s facial recognition technology, but I simply do not understand what all the concern is about. I do agree with Graham Cluley, senior technology consultant at security vendor Sophos comments that Facebook should make this feature an opt-in rather than and opt-out. If you’re a fan of Google Picasa this technology was implemented back in 2009 with Picasa 3.5 and unless you have been living under a rock more and more of our lives is becoming digital.

Client Interface

picasa client interface

Web Interface

picasa web interface

My question to you is simple; does Facebook’s facial recognition go too far? What are your main concerns with this type of technology and how the companies we engage with each and every roll out such technology?

http://www.youtube.com/watch?v=iREJiSgIxAk

Is this the future?

Six Free Online Photo Storage Providers

As we live more and more in a digital world in begins to be much more important to store of photos online in order to share with your friends and family. The purpose of this list is to provide resources that you may or may not be aware of. My personal favorites are Picasa and Flickr in that order.

SnapFish

SnapFish

Crawler Photos

Crawler Photos

PictureTrail

Picture Trail

The Essential Guide to Digital Photography: This 59 page guide is for readers who want to take photography beyond the simple point-and-shoot experience to more advanced skills and techniques. Its an introduction to some essential things you need to know to get started and outlines further resources that you can use to grow as a photographer. With this free guide you will also receive daily updates on new cool websites and programs in your email for free courtesy of MakeUseOf.

ShutterFly

ShutterFly

Zoomonga

Zoomonga

Bravenet

Bravenet

Pix.ie

Pix.ie

Do you know of a service not listed that you highly recommend?

June 2010 SQL Script Collection

Structured Query Language Pronounced “S-Q-L” or “see-quill,” a language used to interrogate and process data in a relational database. Originally developed by IBM for its mainframes, all database systems designed for client/server environments support SQL. SQL commands can be used to interactively work with a database or can be embedded within a programming language to interface to a database. Programming extensions to SQL have turned it into a full-blown database programming language, and all major database management systems (DBMSs) support the language. Each month I intend on posting a collection of scripts that I have found beneficial for myself as well as something that you may be able to put to use.

Military Time Format

DECLARE @d DATETIME = GETDATE()
--ddHHmmMMMyy.toUpper (military format).
--That is two digit day, two digit hour, two digit minute, three letter month, two digit year, and month is uppercase.
SELECT RIGHT('00' + CAST(DATEPART(DAY,@d) AS VARCHAR(2)),2) +
RIGHT('00' + CAST(DATEPART(HOUR,@d) AS VARCHAR(2)),2) +
RIGHT('00' + CAST(DATEPART(MINUTE,@d) AS VARCHAR(2)),2) +
UPPER(LEFT(DATENAME(MONTH,@d),3)) + RIGHT(CAST(DATEPART(YEAR,@d) AS VARCHAR(4)),2)

Retrieve all Primary and Foreign Keys

SELECT t.table_schema AS PrimarySchemaName ,
t.TABLE_NAME AS PrimaryKeyTable,
tc.CONSTRAINT_NAME AS PrimaryKey,
COALESCE(tc2.constraint_schema,'N/A') AS ForeignSchemaName,
COALESCE(rc1.CONSTRAINT_NAME,'N/A') AS ForeignKey ,
COALESCE(tc2.TABLE_NAME,'N/A') AS ForeignKeyTable
FROM INFORMATION_SCHEMA.TABLE_CONSTRAINTS tc
INNER JOIN INFORMATION_SCHEMA.TABLES t ON tc.TABLE_NAME = t.TABLE_NAME
LEFT JOIN INFORMATION_SCHEMA.REFERENTIAL_CONSTRAINTS rc1 ON tc.CONSTRAINT_NAME =rc1.UNIQUE_CONSTRAINT_NAME
LEFT JOIN INFORMATION_SCHEMA.TABLE_CONSTRAINTS tc2 ON tc2.CONSTRAINT_NAME =rc1.CONSTRAINT_NAME
WHERE TC.CONSTRAINT_TYPE ='PRIMARY KEY'
ORDER BY tc.TABLE_NAME,tc.CONSTRAINT_NAME,rc1.CONSTRAINT_NAME

List All Tables That Contain No Triggers

SELECT t.TABLE_NAME FROM INFORMATION_SCHEMA.TABLES t
LEFT JOIN(SELECT OBJECT_NAME(o.parent_obj) AS TableName
FROM sysobjects o
WHERE OBJECTPROPERTY(o.[id], 'IsTrigger') = 1
) tr ON t.TABLE_NAME= tr.TableName
WHERE tr.TableName IS NULL
AND TABLE_TYPE ='BASE TABLE'
ORDER BY t.TABLE_NAME

Calculate An Age Based Upon YYYYMMDD

DECLARE @Birthday DATETIME, @DateToCheck DATETIME
SELECT @Birthday = '19680401', @DateToCheck = CURRENT_TIMESTAMP
SELECT DATEDIFF(YEAR, @Birthday, @DateToCheck) -
CASE WHEN DATEPART(mm,@Birthday) > DATEPART(mm,@DateToCheck)
OR (DATEPART(mm,@Birthday) = DATEPART(mm,@DateToCheck)
AND DATEPART(dd,@Birthday) > DATEPART(dd,@DateToCheck))
THEN 1 ELSE 0 END

Formatting Dates

DECLARE @d DATETIME
SELECT @d = GETDATE()
SELECT @d AS OriginalDate,
CONVERT(VARCHAR,@d,100) AS ConvertedDate,
100 AS FormatValue,
'mon dd yyyy hh:miAM (or PM)' AS OutputFormat
UNION all
SELECT @d,CONVERT(VARCHAR,@d,101),101,'mm/dd/yyyy'
UNION all
SELECT @d,CONVERT(VARCHAR,@d,102),102,'yyyy.mm.dd'
UNION all
SELECT @d,CONVERT(VARCHAR,@d,103),103,'dd/mm/yyyy'
UNION all
SELECT @d,CONVERT(VARCHAR,@d,104),104,'dd.mm.yyyy'
UNION all
SELECT @d,CONVERT(VARCHAR,@d,105),105,'dd-mm-yyyy'
UNION all
SELECT @d,CONVERT(VARCHAR,@d,106),106,'dd mon yyyy'
UNION all
SELECT @d,CONVERT(VARCHAR,@d,107),107,'Mon dd, yyyy'
UNION all
SELECT @d,CONVERT(VARCHAR,@d,108),108,'hh:mm:ss'
UNION all
SELECT @d,CONVERT(VARCHAR,@d,109),109,'mon dd yyyy hh:mi:ss:mmmAM (or PM)'
UNION all
SELECT @d,CONVERT(VARCHAR,@d,110),110,'mm-dd-yyyy'
UNION all
SELECT @d,CONVERT(VARCHAR,@d,111),111,'yyyy/mm/dd'
UNION all
SELECT @d,CONVERT(VARCHAR,@d,112),112,'yyyymmdd'
UNION all
SELECT @d,CONVERT(VARCHAR,@d,113),113,'dd mon yyyy hh:mm:ss:mmm(24h)'
UNION all
SELECT @d,CONVERT(VARCHAR,@d,114),114,'hh:mi:ss:mmm(24h)'
UNION all
SELECT @d,CONVERT(VARCHAR,@d,120),120,'yyyy-mm-dd hh:mi:ss(24h)'
UNION all
SELECT @d,CONVERT(VARCHAR,@d,121),121,'yyyy-mm-dd hh:mi:ss.mmm(24h)'
UNION all
SELECT @d,CONVERT(VARCHAR,@d,126),126,'yyyy-mm-dd Thh:mm:ss:mmm(no spaces)'

Enabling xp_cmdshell in 2005/2008

EXEC master.dbo.sp_configure 'show advanced options', 1
RECONFIGURE
EXEC master.dbo.sp_configure 'xp_cmdshell', 1
RECONFIGURE

Selecting From System Tables in 2005/2008

SELECT * FROM sys.objects  -- new objects table
SELECT * FROM sys.sysobjects -- SQL Server 2000 style objects table
SELECT * FROM sys.all_columns
SELECT * FROM sys.all_objects -- system objects included also with user-defined
SELECT * FROM sys.all_parameters -- stored procedure and function parameters
SELECT * FROM sys.all_sql_modules -- stored procedures, functions, triggers, app views
SELECT * FROM sys.all_views

Converting A String To DatTime

DECLARE
@DateTimeValue varchar(30),
@DateValue char(8),
@TimeValue char(6)

SELECT
@DateValue = '20081023',
@TimeValue = '211920'

SELECT @DateTimeValue =
convert(varchar, convert(datetime, @DateValue), 110)
+ ' ' + substring(@TimeValue, 1, 2)
+ ':' + substring(@TimeValue, 3, 2)
+ ':' + substring(@TimeValue, 5, 2)

SELECT DateInput = @DateValue,
TimeInput = @TimeValue,
DateTimeOutput = @DateTimeValue,
DateTimeFormat = convert(datetime, @DateTimeValue)

List All Tables

SELECT   SchemaName = SCHEMA_NAME(schema_id),
TableName = name
FROM     sys.objects
WHERE    TYPE = 'U'
ORDER BY SchemaName,
TableName
GO

List All Triggers

SELECT   SchemaName = SCHEMA_NAME(schema_id),
TableName = name
FROM     sys.objects
WHERE    TYPE = 'TR'
ORDER BY SchemaName,
TableName
GO

List All Views

SELECT   SchemaName = SCHEMA_NAME(schema_id),
TableName = name
FROM     sys.objects
WHERE    TYPE = 'V'
ORDER BY SchemaName,
TableName
GO

List All Stored Procedures

SELECT   SchemaName = SCHEMA_NAME(schema_id),
TableName = name
FROM     sys.objects
WHERE    TYPE = 'P'
ORDER BY SchemaName,
TableName
GO

Current System Date Conversions

SELECT Now=GETDATE() -- 2016-10-23 18:59:09.483
SELECT CONVERT(datetime, getdate()) -- 2016-10-23 18:59:09.483
SELECT CONVERT(datetime2, getdate()) -- 2016-10-23 18:59:09.4830000
SELECT CONVERT(smalldatetime, getdate()) -- 2016-10-23 18:59:00
SELECT CONVERT(date, getdate()) -- 2016-10-23
SELECT CONVERT(datetime, CURRENT_TIMESTAMP) -- 2016-10-23 18:59:09.483

-- SQL Server current system date functions
SELECT  SYSDATETIME() -- 2016-10-23 19:04:34.28125007
,SYSDATETIMEOFFSET() -- 2016-10-23 19:04:34.2812500 -04:00
,SYSUTCDATETIME() -- 2016-10-23 23:04:34.2812500
,CURRENT_TIMESTAMP -- 2016-10-23 19:04:34.280
,GETDATE() -- 2016-10-23 19:04:34.280
,GETUTCDATE(); -- 2016-10-23 23:04:34.280

-- SQL Server current system date functions with conversions
SELECT CONVERT (datetime, SYSDATETIME()) -- 2016-10-23 19:02:19.547
,CONVERT (datetime, SYSDATETIMEOFFSET()) -- 2016-10-23 19:02:19.547
,CONVERT (datetime, SYSUTCDATETIME())  -- 2016-10-23 23:02:19.547
,CONVERT (datetime, CURRENT_TIMESTAMP) -- 2016-10-23 19:02:19.543
,CONVERT (datetime, GETDATE()) -- 2016-10-23 19:02:19.543
,CONVERT (datetime, GETUTCDATE()); -- 2016-10-23 23:02:19.543

Random Password Generation

DECLARE
@complex tinyint
, @minlen tinyint
, @maxlen tinyint

SET @minlen = 8 --min length of password
SET @maxlen = 12 --max length of password
SET @complex = 4
--  1 all lowercase
--  2 include upper case
--  3 include number
--  4 include punctuation

DECLARE
@password varchar(12)
, @len tinyint
, @type  tinyint
, @type2 tinyint

SET @len = 0
SET @password = ''
WHILE @len NOT BETWEEN @minlen and @maxlen
BEGIN
SET @len = ROUND(1 + (RAND(CHECKSUM(NEWID())) * @maxlen), 0) + 1
END
WHILE @len > 0
BEGIN
DECLARE @newchar CHAR(1)
SET @type = ROUND(1 + (RAND(CHECKSUM(NEWID())) * (@complex - 1)), 0)
IF @type = 1
SET @newchar = CHAR(ROUND(97 + (RAND(CHECKSUM(NEWID())) * 25), 0))
IF @type = 2
SET @newchar = CHAR(ROUND(65 + (RAND(CHECKSUM(NEWID())) * 25), 0))
IF @type = 3
SET @newchar = CHAR(ROUND(48 + (RAND(CHECKSUM(NEWID())) * 9), 0))
IF @type = 4
BEGIN
SET @type2 = ROUND(1 + (RAND(CHECKSUM(NEWID())) * 3), 0)
IF @type2 = 1
SET @newchar = CHAR(ROUND(33 + (RAND(CHECKSUM(NEWID())) * 14), 0))
IF @type2 = 2
SET @newchar = CHAR(ROUND(58 + (RAND(CHECKSUM(NEWID())) * 6), 0))
IF @type2 = 3
SET @newchar = CHAR(ROUND(91 + (RAND(CHECKSUM(NEWID())) * 5), 0))
IF @type2 = 4
SET @newchar = CHAR(ROUND(123 + (RAND(CHECKSUM(NEWID())) * 3), 0))
END
-- remove invalid characters as well as characters easily confused with others
IF @newchar NOT IN ('b', 'l', 'o', 's', 'I', 'O', 'S', '0', '1', '!', '''', '.', ',', '/', '`', '', '|')
BEGIN
SET @password = @password + @newchar
SET @len = @len - 1
END
END
SELECT @password as Password

Copy Data From One Table Into Another

INSERT INTO    [TABLE2]
SELECT *
FROM [TABLE1]

Basic Cursor

declare @email nvarchar(255)
declare CustList cursor for
SELECT email from STE_EMAILS
OPEN CustList
FETCH NEXT FROM CustList
INTO @email
WHILE @@FETCH_STATUS = 0
BEGIN
if (SELECT count(custid) from customer where (current_customer=1) and (notes1 is not null) and (notes1 like '%' + @email + '%')) > 0
SELECT custid from customer where (current_customer=1) and (notes1 is not null) and (notes1 like '%' + @email + '%')
print '%' + @email + '%'
FETCH NEXT FROM CustList INTO @email
END
CLOSE CustList
DEALLOCATE CustList

Do you have a script that you would like to share? Feel free to contact me and I will add it to the list.