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

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

|Categories :   Comments [0] Trackback
April 1, 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

March 22, 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


 

|Categories :   Comments [0] Trackback

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.

 

|Categories :   Comments [0] Trackback
April 23, 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

|Categories :   Comments [2] Trackback
April 18, 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.

|Categories :   Comments [1] Trackback
April 18, 2007  

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

|Categories :   Comments [0] Trackback
April 18, 2007  

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

|Categories :   Comments [0] Trackback
April 11, 2007  

So I had a really annoying thing happen today with Word 2007. I was trying to work with a document and it would not let me select the text using my mouse.  Hmmmm... thats weird??  So of course I do what any sane person would do... Reboot ;)

Well that didnt fix it (I thought maybe it was a result of docking/undocking without a restart)

After digging around a bit (Googling) I found out I was not the only one to have this problem. I am still not sure what caused it but was able to find a fix.

****  Use at your own risk *******

. Close Word and Outlook
2. Start / Run and type regedit
3. Navigate to HKEY_CURRENT_USER\Software\Microsoft\Office\12.0\Word\Data
4. Rename this key.
5. Restart Word

That fixed the problem for me. Maybe when I have time, I will hunt down the actual reason for this but for now I need to use word ;)

Doc

|Categories :   Comments [0] Trackback
March 20, 2007  

 

Here are the files for my Building an ASP.NET Website from End to End Talk Today.

Download Files

Doc

Working with SQL output Caching and SQL 2005 is a little different then working with SQL 2000. Here is a great resource on how to set this up for your ASP.NET pages.

http://msdn2.microsoft.com/en-us/library/ms379559(VS.80).aspx#caching_topic2

I could not have said it better myself ;)

Doc

|Categories :   Comments [0] Trackback
March 15, 2007  

Just in case anyone else is having problems getting debugging to work with Visual Studio 2005 and IIS7, here is a link that will fix your problem.

http://mvolo.com/blogs/serverside/archive/2006/12/28/Fix-problems-with-Visual-Studio-F5-debugging-of-ASP.NET-applications-on-IIS7-Vista.aspx

 

Thanks Mike….

|Categories :   Comments [0] Trackback