Wednesday, April 09, 2008

I wanted to thank everyone for attending my talk on the Past, Present, and Future of ASP.Net AJAX. You will find both the PowerPoint slides and the sample code below. If you have any questions be sure to drop me a line.

 

Happy Programming

Doc (Daniel Egan)

A PDF Version of the Presentation : LaunchVS2008PDF.zip (1.57 MB)

The Main Project website for the presentation : Launch2008MainProject.zip
Required for Project :
Visual Studio 2008 or Visual Web Developer 2008 Express (FREE)
Downloaded and installed ASP.Net AJAX Control Toolkit

The project showing the Ajax History Injection :History1.zip
Required For project :
ASP.Net Extentions Preview

posted on Wednesday, April 09, 2008 10:17:04 AM (GMT Daylight Time, UTC+01:00)  #    Comments [0] Trackback
Thursday, April 03, 2008

Don't Miss it!!! Code Trip is coming to your town. I was able to attend both the LA and Irvine Code Trip events and a great time was had by all.

Tim Heuer Woody Pewitt and Jason Mauer (Microsoft DE's) are roaming around the country on a bus to spread the word.

Check out the site and where they will be next at http://thecodetrip.com/

The site is a cool combination of LINQ, Silverlight, Virtual Earth, and other cool MS goodies. If you have time find a location near you and check it out.

 

Doc

posted on Friday, April 04, 2008 12:15:20 AM (GMT Daylight Time, UTC+01:00)  #    Comments [0] Trackback
Tuesday, April 01, 2008

While trying to copy a Virtual Machine onto one of my back-up drives I ran into the "Not enough space on drive" error. Of course the drive I was copying to was 500GB so I knew that I had space.

After a little bit of checking I realized that the drive was still FAT32. I had never converted it to NTFS. FAT32 wont let you copy anything over 4GB.

Anyway, to fix this is pretty easy, you can use the command line tool convert.exe to change the file system from FAT32 to NTFS. 

the following command will do the trick --   convert D: /fs:ntfs (where D is the drive you want to convert)

Now I am able to copy over those 10GB files. :)

I know this is old news to some but..... It is easy to forget what you dont use ;)

Doc

posted on Wednesday, April 02, 2008 12:30:24 AM (GMT Daylight Time, UTC+01:00)  #    Comments [0] Trackback
Sunday, March 23, 2008

At my last talk I had the following question.

"When returning a LINQ entity using the .Single() extension, what would happen if the result returned more than one row?"

The simple answer of course was that it would throw an exception, but I told him I would elaborate in a blog post. So here it is. Most LINQ queries will return an IEnumerable collection of objects as the result of your LINQ query. In order to only return a single entity, you have a couple of options.

 

Single – Will return back a single entity
SingleOrDefault – Will return back a single entity or a Default if nothing is found

Both of these will throw an InvalidOperationException if the query returns more than one row.

If you know that your query may return more than one record, you can use the following Extension methods to return a single entity from a collection of entities. (or the OrDefault versions)

ElementAt - return the entity at the given index

First - Returns the first entity of the collection

Last – Returns the last entity in the collection.

Finally, you can also pass a predicate (a condition) as a parameter.

Here we are looking for the first publisher in the pubisher collecdtion that has a country of USA.

 

Hope that helps.

Happy Programming

Doc


 

posted on Sunday, March 23, 2008 10:57:52 AM (GMT Standard Time, UTC+00:00)  #    Comments [0] Trackback
Tuesday, March 18, 2008

So during my last LINQ talk, I had a couple of people ask me why Partial Method were both implicitly private and must return void. So as to not slow down the presentation (we had a lot to cover) I told them I would blog an answer for them. Here it is.

So first, let's set up our sample program. We created two partial classes. One with the partial methods implemented.

namespace CSharpBlogSample

{

internal partial class Account

{

//Partial Methods (NOT IMPLEMENTED)

partial void OnWithdraw();

partial void OnDeposit();

}

 

internal partial class Account

{

//Partial Method (IMPLEMENTED)

partial void OnWithdraw()

{

Console.WriteLine("Withdrawing Money...");

}

partial void OnDeposit()

{

Console.WriteLine("Depositing Money.");

}

 

}

}

If we dig down into the IL we will see the following.

Notice how the OnDeposit and OnWithdraw methods are compiled into the dll.

If we compare that with a implementation where we do not implement the partial methods you will notice that the methods will be missing from the IL code.

namespace CSharpBlogSample

{

internal partial class Account

{

//Partial Methods (NOT IMPLEMENTED)

partial void OnWithdraw();

partial void OnDeposit();

 

}

 

 

}

This is important; if these partial methods were not implicitly private and you tried to access them from another class, you would run into trouble when they don't exist.

This is the same reason that we also need to return void.

Let's say that we wanted to call our private methods from inside our class in a "CallMyMethods" function (shown below)

internal partial class Account

{

//Partial Methods (NOT IMPLEMENTED)

partial void OnWithdraw();

partial void OnDeposit();

 

void CallMyMethods()

{

 

OnDeposit();

OnWithdraw();

 

}

}

 

Since we are not implementing them in a separate partial class the methods will not be implemented inside of the CallMyMetods function.

 

If you were allow to return something, and were in turn using that as a return value from your CallMyMethods fuction, you would run into trouble when the partial methods were not implemented.

 

Hope that helps.

Happy Programming

Docwww.

 

posted on Tuesday, March 18, 2008 6:16:31 AM (GMT Standard Time, UTC+00:00)  #    Comments [0] Trackback
Tuesday, April 24, 2007

 

You know what…. As much as I like Vista, it is really getting on my nerves. Not only have I lost my multi-monitor support ( I used to run four monitors) but I was having the stupidest problem with Visual Studio. I was not able to Debug in Visual Studio. So, of course, I tried to download all the patches and upgrades to fix this seemingly ubiquitous problem. But none of this worked.

Turns out, you have to right click on Visual Studio and "run as administrator" to enable debugging in VS 2005 on Vista. What a crock… not to mention how many hours I spent trying to fix it. I should have Googled it from the beginning.

 

Doc

posted on Tuesday, April 24, 2007 10:27:34 AM (GMT Daylight Time, UTC+01:00)  #    Comments [2] Trackback
Thursday, April 19, 2007

As many of you know, Microsoft has decided to name WPF/E (Windows Presentation Foundation/Everywhere) Microsoft Silverlight. It is a pretty cool name, but what is really cool is that it is named after one of my friends David Silverlight. Microsoft has launched a new campaign to reward community involvement. You can read about David's meeting with Bill and how the name came about here.

posted on Thursday, April 19, 2007 6:48:27 AM (GMT Daylight Time, UTC+01:00)  #    Comments [1] Trackback

So I just found this cool new tool called ZoomIT. I have used others in the past to help when doing technical presentations but this one is great. It is simple and too the point and allows me to use a marking tool on my screen. ;)


http://www.microsoft.com/technet/sysinternals/Miscellaneous/ZoomIt.mspx

 

Happy Presenting…

Doc

posted on Thursday, April 19, 2007 4:36:06 AM (GMT Daylight Time, UTC+01:00)  #    Comments [0] Trackback

So I just found this cool new tool called ZoomIT. I have used others in the past to help when doing technical presentations but this one is great. It is simple and too the point and allows me to use a marking tool on my screen. ;)

http://www.microsoft.com/technet/sysinternals/Miscellaneous/ZoomIt.mspx

Happy Presenting…

Doc

posted on Thursday, April 19, 2007 4:28:38 AM (GMT Daylight Time, UTC+01:00)  #    Comments [0] Trackback