Archive

Posts Tagged ‘c#’

Upcoming Speaking Events

August 18, 2014 Leave a comment

I have several speaking events going on this week and next.

Tomorrow, I will speaking to the TechTalent South.  My topic will be, “Building Applications with Ubiquity in Mind”

This coming Friday, 8/22, I will be hosting and presenting the Unity 2D Workshop.  This event will be all day.

Next Tuesday, I am speaking to the Charlotte Enterprise Developers Guild.  My topic will be, “Building Line of Business Applications using AngularJS”

Hope to see you at one of these events!

Categories: English Tags: , , , , ,

.NET Uri, database not found, and encoding

I ran into an interesting issue when trying to debug some code a while back.  I had written a dynamic that would allow a person to authenticate and then pick a database in which to perform their operations.  For the most part, this system worked well and allowed me to keep things simple.  The part that was trick was that I had written my reporting and dashboard engine to use a single Razor .cshtml file to handle all requests.  It in turn pulled the report definition or dashboard definition XML files from the database.  The problem came when one of the SQL Server databases that the system was deployed was not the default instance but a “named instance“.

In my code, I would simply construct an Uri object and pass in the string that represented the parameters that I needed for the given page.  However, since a named instance uses the ‘\‘ character, this caused some problems as my simple string representation was not encoding the character and thus when the server received the request it was not a valid server name.  I spent hours thinking that it was a problem with the configuration with SQL Server.  It wasn’t until I debugged the .cshtml file that I realized that the name of the server was not coming across correctly and that I was not encoding the name properly.  Here is what I finally came up with to correct the issue:

string address = string.Format("../PreviewReturnSetupBillDesigner.cshtml?
Key={0}&ServerName={1}&DatabaseName={2}",
  101,
  HttpUtility.UrlEncode("monticello\test"),
  HttpUtility.UrlEncode("sample"));

Uri uri = new Uri(address, UriKind.RelativeOrAbsolute);

Previously, I was just passing in the server and database names without encoding them. This worked for all default installations of SQL Server but once you had a named instance in place, all bets were off.

Hopefully this will help anyone from spinning their wheels if they are doing anything similar…

Introducing Unity

February 27, 2014 1 comment

Update:  I had a great time speaking at the WNC .NET Developers Guild last week.  You can grab the slides and code below!

I had a great time speaking at the Enterprise Developers Guild last night.  We had a great turnout and I wanted to make my slides and code available to all who are interested.  You can grab the slides from here and you can either check out or download the Unity project here.

NOTE:  When you first open the project in Unity and you don’t see anything, be sure to click on the Scenes folder and double-click level1.  This will load that scene and then you should be able to play with the game as it is.

Thank you to everyone who came out…

Windows 8.1 and Visual Studio 2013

October 16, 2013 Leave a comment

I had a great time presenting at the GSP Developers Guild last night.  Thanks to everyone for letting me go a little long on the presentation!  There was so much to cover and I still didn’t show everything that is new and exciting.

Here is a link to my presentation.

Thanks to everyone for coming out….

Windows 8 – Cage Match – XAML vs. HTML

October 10, 2013 Leave a comment

I had a great time presenting with Brian Hitney over Windows 8 at the Charlotte ALT.NET user group this past Tuesday night.  We had some very good discussions concerning developing applications using XAML and HTML.

Here is a link to the slides.

Thanks to all who came out!

Mastering Ninject for Dependency Injection

October 2, 2013 2 comments

I am happy to announce that the book, Mastering Ninject for Dependency Injection has been published.  I worked on the project as a technical reviewer and had a lot of fun.

Mastering Ninject for Dependency Injection

If you are interest in a great reference for Dependency Injection (DI), this is a good one.  It goes deep for those of you who really want to take full advantage of a mature DI container.

I would like to thank Packt Publishing for reaching out to work on this title.

Game Design and Unity

September 11, 2013 3 comments

I had a great time talking Monday night on Game Design and Unity.  Here is a quick synopsis of what I covered:

 

Probably the hardest part of game development is just getting started.  We will take a look at focusing on creating your own Game Design Document.

Once we review the general concepts of our document, we will jump into a live session of building a quick app as well as using 2D Toolkit.  We will cover the following topics:

• Input: Touch and Keyboard/Controller

• Particle System

• Collision Detection

• Finite State Machines (FSM)

• Sprite Collections and Animations

• Dicing your sprite sheets

• Sprite Batching

Thank you to everyone who came out and attended!  We had a full house and that is always nice.

I also wanted to post the link to my slides documents and source code made during the talk.

Until next time…