2005 2006 2007 2008 2009 2010 2011 2015 2016 2017 2018 aspnet azure csharp debugging docker elasticsearch exceptions firefox javascriptajax linux llblgen mongodb powershell projects python security services silverlight training videos wcf wpf xag xhtmlcss

Atlas October 2005

If you are anything like me, you consider a technology is new as long as it's marked as experimental. Atlas still qualifies for being new...or even, pre-new. In any case, the October 2005 version of Atlas has been released and can be downloaded at the link below.

http://atlas.asp.net/

You can find a list of changes here: http://weblogs.asp.net/atlas/

Note that unlike WCF and WPF, which in my mind are stable for production, Atlas is still experimental and is only in the technical preview stages. Not that it will explode into pieces, but there is little to no documentation on almost all of Atlas and given the early nature of the product, things are almost guaranteed to change.

Cool SMS/VS2005 Integration Feature

Today I discovered a very wierd feature regarding SQL Management Studio 2005 ("SMS") and Visual Studio 2005 (of course I'm using the FREE standards editions from the MSDN/Technet seminars)

OK so here it is...

  • Open SMS
  • Navigate to a table and modify it.
  • Copy the text of one of the columns
  • Go to an ASPX page in Visual Studio 2005 and paste.

If you did it right you will see the weirdest thing in the world: it pastes a GridView linked to a SqlDataSource, which it also pastes.

<asp:GridView ID="GridView1" runat="server"
     DataSourceID="SqlDataSource2"
     EmptyDataText="There are no data records to display."
     AutoGenerateColumns="False">
    <Columns>
        <asp:BoundField DataField="ContactID"
            SortExpression="ContactID"
            HeaderText="ContactID">
        </asp:BoundField>
    </Columns>
</asp:GridView>
<asp:SqlDataSource ID="SqlDataSource1" runat="server"
    SelectCommand="SELECT [ContactID] FROM [Employee]"
    ConnectionString="<%$ ConnectionStrings:AdventureWorksConnectionString1 %>"
    ProviderName="<%$ConnectionStrings:AdventureWorksConnectionString1.ProviderName %>">
</asp:SqlDataSource>

You will also find that it pastes the appropriate connection string directly into your web.config.

<add
 name="AdventureWorksConnectionString1"
 connectionString="[string omitted;  it was LONG"
/>

Cool, huh?

p.s. If you want to paste that particular name, as I wanted to do, you can always do the old school paste-into-notepad-copy-out-of-notepad trick that is a tried and true way to strip off Web Browser formatting.

Firefox 1.5 released!

The last 32 days rocked! The release of .NET 2.0 and now Firefox 1.5. Both are absolutely revolutionary in their technology.

So, go get it! Woohoo!!! The link is in the list below.

Also, I remind everybody about my "What's new in Firefox 1.5" video, which is also in the list of links below.

...and yes, Chris Pederick's Web Developer Toolbar works great with Firefox 1.5. His page link is also below...

Learn WCF via MSDN Nuggets

Want to learn WCF (a.k.a. Indigo)? If so, you should head on over to MSDN UK to see Mike Taulty's latest MSDN Nuggets.

http://www.microsoft.com/uk/msdn/events/nuggets.aspx

Currently there are three videos:

  • Hello World
  • Type Serialization
  • Bindings

You will find that WCF looks much like old-school COM, but has the power of MSMQ, COM+, remoting, Web Services and the simplicity of .NET. Awesome!

For more information on WCF check out this great MSDN article: http://msdn.microsoft.com/library/en-us/dnlong/html/introtowcf.asp.

.NET Wikipedia Entry Edit

OK so I got SICK of the horrible midunderstandings written about .NET on Wikipedia...so much so that I rewrote much of it.

As of right now, 95% .NET 2.0 material written at http://en.wikipedia.org/wiki/Microsoft_.NET was written by me. The only parts I didn't write were the top two 'changes in 2.0' bullets. I added all other .NET 2.0 content.

Here are some snippets I added regarding .NET 2.0

".NET 2.0 is a severe redesign of not only the technology, but also the model of Microsoft's .NET agenda. While .NET v1.x was considered more of a Rapid Application Development (RAD) model and was often compared with Sun's Java. C# 2.0, part of the .NET 2.0 model, is now compared more closely with C++, so much so infact, that large portions of Microsoft's Windows Vista are written in C# and the .NET framework."

I also added information about how .NET was NOT the competition for Java, but was infact originally intended to be COM+ 2.5 by one team and "Next-Generation Web Services" by another. In addition, I removed anything about .NET 2.0 betas and updated the information about the express editions to be more proper.

New Blog

In addition to my WinFX blog I'm also going to be working on this new dynamics blog, called Dynamic Bliss. This blog will cover client-side topics such as XML based, out-of-band procedure calling ("Ajax" though I don't approve of that name), ECMAScript dynamics, dynamic graphics, widget creation, other topics from my book and a few other browser-related topics.

This blog is the replacement of a book I was working on regarding the same topic. I'm a strong believer that blogging is the new book (for technology at the moment). Parts of the blog will include video chapters from the my video book as well as my Firefox Web Development Suite videos.

You can get to the blog here, Dynamic Bliss.

WSE3 MTOM

OK, so this week I found out that that there currently is no support the the Jet database provider on the x64 platform. That didn't change the fact that I was determined to do it (or create the illusion of it). I had to create a user-approachable report generator which exported the data into Excel and sent it on to the user all via a web interface. I also didn't want to use the XML version of Excel spreadsheets (it surprises me how many times people think I'm talking about Excel 12 when I say that. You can do XML-based sheets in old Excel versions too!) So I wanted this done via ADO.NET and the Jet provider creating a "real" xls file. Obviously what I wanted to do isn't even work with the framework, but…doing it on x64 is.

The solution? Simple, WSE3 provides you with the ability to use SOAP Message Transmission Optimization Mechanism (MTOM) very seamlessly. MTOM is a new W3C recommendation used to optimize messaging scenarios that involve transmitting binary data. Technical gibberish aside, MTOM is just AWESOME. Using WSE3/MTOM, all I had to do was create a WSE3 service on a different server which created the XLS binary data and returned to back to the caller which then sent it on to the client.

Want specifics? MSDN has a document which provides you with the hands-on training you sufficient to propel you into WSE3 services: WSE3 Hands-on Lab: Messaging. MTOM is the third lab, but basically all you do is enable WSE3 (and MTOM) on the client and server, set the server up to return a byte array to the caller, call the server, and stream that byte array into a file. In my case I then sent it out to the user...

Here's my code for sending the Excel worksheet out to the user...

Response.Buffer = true;
Response.Clear( );
Response.ClearContent( );
Response.ClearHeaders( );


Response.AddHeader("Content-Disposition", "attachment; filename=" +
 "AutoGeneratedReport.xls");
Response.AddHeader("Content-Length", file.Length.ToString( ));
Response.ContentType = "application/vnd.ms-excel";
Response.WriteFile(fullpath);
Response.Flush( );

I'll have to beef up on WSE3 a bit for a future SOA lecture in my WinFX/.NET course.

.NET Course I'm teaching

So, for a while now I've been teaching a .NET 2.0/C# 2.0/Object-oriented desing class and decided to come up with a simple class website.

I'm covering not only the basics, but also many advanced topics that you would only find in footnotes. Mainly I'm going to be covering stuff that I wish someone would explain to me in plain english!! So, I'm going to be spending time explaining the differences between ref and out, const and readonly, and try{}catch{} and try{}catch(Exception ex){} among other topics. You can bet that I'll be spending A LOT of time just on delegation!!

There are actually a few series going on at once: C# Language (Intro, Intermediate, Advanced), .NET Framework and Design, Object Orientation and Design Patterns, SOA and Enterprise Development, ASP.NET 2.0 (web-standards "tableless"/CSS!!!), and WinFX concepts are the series all going on in parallel.

As far as the intro ASP.NET stuff is concerned, there are great ASP.NET books out for that kind of stuff. I'm mainly focusing on the middle layer and more advanced concepts. I'm actually planning a lecture for Microsoft Atlas. Given my love for Firefox, .NET, and remote scripting (err, Ajax), that should be fun! Also in the course of things I plan on having a lecture to discuss .NET design guidelines and another lecture on the architecture and mechanics of the CLR! .NET assembly language (yeah, yeah, the IL) rules!

Now what is my supplemental book recommendation? Basically anything that Troelsen has written. His latest book "Pro C# 2005 and the .NET 2.0 Platform" is written incredibly eloquently.

I absolutely love .NET... and this should show! maybe I can get an MVP out of this :D hint hint!!

Anyhow, here's the page I threw togther for it. I'll be posting more information, links, and samples as time goes along.http://www.davidbetz.net/dotnetcourse/

A few .NET 2.0 life simplifiers...

I'm starting to realize that not everyone knows everything or watches every blog in the cosmos, so I'll start including blog entires which will help people very efficiently master .NET 2.0 and WinFX.

One thing that will help people who currently fight with .NET 1.x is the following video I saw earlier this month. It's an explanation of some of the life simplifiers in .NET 2.0.

One of my favorites they talk about is is the addition of a Contains( ) method for things. Now instead of typeing "string".IndexOf("str") > -1, we can use Contains( ). My next favorite thing...well, about a tie, would be the additions of the String.IsNullOrEmpty(string) method to replace if(myString == null || myString.Length < 1). Nice...

OK, so here's the video...

"Favorite v2.0 Features in the Base Class Libraries"

C# 2.0 Self-Test



In the .NET course I'm teaching (".NET Complete") I gave a little project to the class, of which all of them are new to OO design, C#, .NET, and all the related items. The project requirement was for them to study the example and see what it does. The point of the project was to allow them to test their knowledge of C# syntax, collections, generics, and nullable types

It's almost as useless as "Hello World". Or,rather, hello world is almost as useless as this.

You simply type in string and it tokenized it into characters…but they didn't know that.  Anyhow here you go…

using System;
using System.Collections.ObjectModel;
using System.Collections.Generic;

namespace CodeExamples { class Program { class Storage<T> where T : ICollection<Char>, new( ) { private Dictionary<String, T> list = new Dictionary<String, T>( );

        <span style="color: rgb(0,0,255)">public</span> <span style="color: rgb(0,0,255)">void</span> ShowLines( ){
            <span style="color: rgb(43,145,175)">Int32</span>? i;
            <span style="color: rgb(0,0,255)">foreach</span>(<span style="color: rgb(43,145,175)">KeyValuePair</span>&lt;<span style="color: rgb(43,145,175)">String</span>, T&gt; collection <span style="color: rgb(0,0,255)">in</span> list) {
                i = <span style="color: rgb(0,0,255)">null</span>;
                <span style="color: rgb(0,0,255)">if</span>(collection.Key.Length &gt; 2) {
                    i = collection.Key.Length;
                }


                <span style="color: rgb(43,145,175)">Console</span>.Write((i ?? -1) + <span style="color: rgb(163,21,21)">" : "</span> + collection.Key + <span style="color: rgb(163,21,21)">" : "</span>);
                <span style="color: rgb(0,0,255)">foreach</span>(<span style="color: rgb(43,145,175)">Char</span> thing <span style="color: rgb(0,0,255)">in</span> collection.Value) {
                    <span style="color: rgb(43,145,175)">Console</span>.Write(thing);
                }




                <span style="color: rgb(43,145,175)">Console</span>.WriteLine();
            }
        }


        <span style="color: rgb(0,0,255)">public</span> <span style="color: rgb(0,0,255)">void</span> Save(<span style="color: rgb(43,145,175)">String</span> text) {
            T parts = <span style="color: rgb(0,0,255)">new</span> T( );
            <span style="color: rgb(0,0,255)">foreach</span>(<span style="color: rgb(43,145,175)">Char</span> c <span style="color: rgb(0,0,255)">in</span> text.ToCharArray( )) {
                parts.Add(c);
            }


            <span style="color: rgb(0,0,255)">if</span>(!list.ContainsKey(text)) {
                list.Add(text, parts);
            }
        }
    }


    <span style="color: rgb(0,0,255)">static</span> <span style="color: rgb(0,0,255)">void</span> Main(<span style="color: rgb(43,145,175)">String</span>[] args) {
        <span style="color: rgb(43,145,175)">Storage</span>&lt;<span style="color: rgb(43,145,175)">Collection</span>&lt;<span style="color: rgb(43,145,175)">Char</span>&gt;&gt; storage = <span style="color: rgb(0,0,255)">new</span> <span style="color: rgb(43,145,175)">Storage</span>&lt;<span style="color: rgb(43,145,175)">Collection</span>&lt;<span style="color: rgb(43,145,175)">Char</span>&gt;&gt;( );


        <span style="color: rgb(43,145,175)">Boolean</span> done = <span style="color: rgb(0,0,255)">false</span>;


        <span style="color: rgb(0,0,255)">while</span>(!done) {
            <span style="color: rgb(43,145,175)">String</span> text = <span style="color: rgb(43,145,175)">Console</span>.ReadLine( );


            <span style="color: rgb(0,0,255)">if</span>(text == <span style="color: rgb(163,21,21)">"end"</span>) {
                done = <span style="color: rgb(0,0,255)">true</span>;
                <span style="color: rgb(0,0,255)">continue</span>;
            }


            storage.Save(text);
        }


        storage.ShowLines( );
        <span style="color: rgb(43,145,175)">Console</span>.ReadLine( );
    }
}

}