CodeBetter.Com
CodeBetter.Com
RSS 2.0 via Feedburner
           Do you Twitter? Follow us @CodeBetter

John Papa [MVP C#]

.NET Code Samples, Data Access, and Other Musings

October 2005 - Posts

  • Academia and Vegas? - Hmmm

    On Veteran's Day weekend I will be presenting at the Microsoft Academic Alliance conference in Las Vegas. When I was first asked about this I had to take a step back ... Las Vegas .... Academics? They just don't seem to mix ... but hey, I'm game! In all seriousness, I am looking forward to presenting at this conference as the attendees all make their livings in the academic world. It seems like a great opportunity to see what and how the teachers/professors are teaching the college students. It will be interesting to hear their questions to see how they view the fast changing world of development with .NET. Dino Esposito will be there as well as a few other presenters. I'm looking forward to saying hi to my old friend Dino as I have not seen him in a few years now.

    Oh, and I'll be sure to play Red 19 when I take a break from the craps table! :-)

     

    Posted Oct 31 2005, 03:22 PM by John Papa with no comments
    Filed under:
  • iExpectedMore - Well, me too!

    Scott Stewart relives his most recent experience with customer service. Scott's is only one experience, but it makes you wonder why customer service in general ever responds like he says they did to him. In short, Scott's blog relives an experience where he brought a laptop to a store where he had an appointment with their customer service to look over why the laptop was so hot. The guy basically said they had to ship it out. According to Scott's post, the customer service guy wouldn't try to listen to the symptoms, wouldn't try to swap out hardware pieces to see if they could figure out what part was the culprit, and wouldn't even talk to him. You can read the entire experience on his blog which he calls iExpectedMore.

    Disclaimer: OK ... this post is not about any specific company but rather about what customer service should be. Any scenarios contained within are ficticious and meant to drive home the point.

    Think about those software vendors out there that let you buy a product, try it out and if you do not like it, you can return the license and get your money back within a certain time frame. Or the electronic stores that have the same no risk no hassle policy! What a concept!  That instantly draws me to try it out and even if I do not like the product, I will consider that company in the future. It is good customer service! (Yes, those words can be in the same sentence)

     

    if (customerServiceAgent.Listen == false)

       customer.LikelihoodToBuyAgain == false;

     

    <rant>

    ... This is a HUGE frustration point of mine ...

    OK, forget Apple for a minute ... just consider customer service in a broader sense. What do you really want when you have a problem with your widget? First and foremost they want it fixed. That was easy, but et's go deeper since most issues can;t just be fixed with magic pixie dust. People generally want to talk to a live person, who is educated on the matter, promptly available and listens to what you have to say. For example, I don;t want to call customer service about my widget and have to wait an hour to get to a person only to transfer to another person because they don;t know enough about my widget to help me. I also don;t want to hear that I should send it in before they even listen to what is wrong.

    Here is a major point that customer service departments should all get, but they don't: Customer service is about the customer. Why is this so hard to understand? When the customer contacts customer service the customer wants to hear "I'll take care of it". That simple phrase defuses the situation in most cases. Listen to the customer's issues, let them get their frustration out and tell them you will find the answer. You don;t have to find it then and there, that's not my point. You very well may have to ship the product away to get it fixed, but that is not a reason to tick off your customer by not even letting them tell you about the issue. Think about this for a second ... if you have a broken computer you are frustrated. You want to tell someone about it. It helps blow off the frustration. When a customer service agent listens to this and says here is what we're going to do to solve this you think 'geez, s/he is going to help me get this solved'. You feel better. You want to work with the company again. The customer experience should be enjoyable.

    1. Returns should be easy with no hassle
    2. Customer service should listen
    3. If products get shipped away, replacements should be available (temporarily or permanently)

    Yes, customer service costs money. But it buys my loyalty and my future dollars.

    </rant>

  • Woo hoo! I Passed 8th grade math!

    Geoff passed 8th grade math so I thought I would join him in Jr High :-)

    What is funny is that my daughter is doing math in 1st grade that I was doing in 4th grade. Boy has school changed!

     

    You Passed 8th Grade Math
    Congratulations, you got 10/10 correct!
  • CodeRush vs Resharper - Round 2

    To add to my last post on comparing Resharper and CodeRush ... I spent some more time with each of these products and something that stuck out right away was that they don;t play well together. I had several features run into each other (intellisense, templates, and keys that do different things) Yeah, I should have expected this and I guess deep down I did, but I was holding out hope that I could use both simultaneously. So I had to turn 1 off to truly test the other and then vice versa. It was a bit annoying that if I turned off CodeRush in the add-ins menu that it would unload, then reload. I had to close Visual Studio.NET to get it to stay unloaded. Like a telemarketer it just wouldn't stop getting in my face! I did not have this problem with Resharper as once I unloaded it it stayed down. While this was annoying, I can't condemn the product for this, not if it turns out to be better for development (jury is still out in my mind as I give them both a fair shake).

    Another thing that I noticed is that it takes about 1 minute to load my massive project into Visual Studio.NET when Resharper is running. It likely is loading all of its metadata, which caused my project to go from taking about 15 seconds to load to about 55 seconds. Not killer, but still an annoyance. CodeRush did not provide any noticeable delay to the loading of my project, which really stood out. But if I have to live with a delay at load time to gain the "Find Usages" and the "Analysis/Code Checking" features of Resharper, I'll take the good with the bad.

    So far I haven't seen any compelling evidence (although there are some very useful features) that would cause me to use CodeRush over Resharper. Although, I am still going to delve deeper into both to see what else there might be that I am missing.

    If you have had experience comparing the 2 products, what did you find?

  • Resharper vs CodeRush and Refactor Pro - Round 1

    I've developed .NET applications with both of these products in the past and they both have some great features that save a ton of time. It had been a while though since I last did a comparison, so I decided to put them up to the challenge once again. Here are my initial thoughts on the best pros and cons of each. They both have some great refactoring features, however they also each had some good differentiating features too. I've just started my revisit to these 2 products which I plan on comparing in real development over the next few weeks. But here is my initial thoughts on the 2 of them ...

    Top 3 features that Resharper has over CodeRush/Refactor Pro:

    1. Analysis icon (shows code errors before you build) - This is just awesome!!!
    2. Find Usages (finds all usages of a class, interface, etc.)
    3. Optimize "usings" (removes unnecessary using statements)

    Top 4 features that CodeRush/Refactor Pro over Resharper:

    1. Better templates out of the box (helps write code faster)
    2. Quick Find (helps find a method, property, class or whatever very quickly)
    3. Better visual enhancements (blocks the regions well, blocks code nicely, auto-highlights easily, shows code flow nicely with visual cues)
    4. Use of markers

    If you could combine some of the features you would have a great product! I love Resharper's analysis tools!!! If you ahven;t seen it, try it out. What they do is check your code for compile errors and even for warnings while you type. So before you even build your code you will see an indicator that shows green (all is well), orange (warnings exist), or red (something is amiss). Warnings could be something like you declared a field that you never use, which is helpful for cleaning up your code.

    The Find Usages feature of Resharper is incredible, too. I recently had to work on a few major refactor jobs where I had to change about a dozen classes and every place that used them. This ended up effecting about 50 files as the application was very OO and the levels of inheritence and interface usage was deep. The Find Usages feature of Resharper made this soooooooo much easier on me. Whenever I changed a class I first looked up all usages of it so I could make sure I tested those paths as well. When I changed the signature for methods or constructors, it updated the usages for me! Very slick indeed.

    These 2 features of Resharper alone are just incredible, IMO.

    I do find that the templates in CodeRush to be much better out of the box. Writing code with them is so much easier than without. For eaxmple, to declare a local variable I just type "fi[space]" and it inserts a int for me. If I type "pi[space]" it inserts the template for a full Property with get and set accessors. Very slick. There are a ton of single and multi key templates that you can use. I plan on testing them all out to see how they compare to Resharper, but so far they seem a ton better in CodeRush.

    OK, maybe its trivial, but I have to admit that CodeRush has some nice visual features that caught my eye right away. It makes regions look more visually disparate than with CodeRush. It does this by making the region be a highlights rectangle when closed. Does it help me code? Nah, but its a nice visual feature. But I added it in this post because it maakes me wonder why other products don't offer this (or maybe they do and I am not aware). CodeRush goes further by putting icons next to classes, properties, methods, interfaces, etc to help denote if they are private, public, internal or whatever. Again, another nice feature but it isn't likely to help me code faster. Where it is smarter is when you click on the icon of, say, a public class, it gives you a pull down list of other options besides "public". So you can change a class to "private" in this manner. The best visual feature may be how it shows control of flow, though. For example, if you have a return statement CodeRush shows a green arrow next to the return. If you click the green arrow a graphic appears that points you to where the return statement exits the routine. Similar graphical features also exist with the continue, break and exception throwing commands. These are very slick.

    OK, so far I am still on board with Resharper. I think the featureset with CodeRush is more extensive that Resharper and frankly it look a lot fancier that Resharper. But I just don't think I can live without the Find Usages and Analysis features of Resharper. The template features of CodeRush are very appealing though. Maybe someone will create a tool that combines the best of both worlds from these products.

    Stay tuned ... I'll post more about how my experience goes with both of them.

    For me, Round 1 goes to Resharper on a 2 to 1 decision.

  • Code Samples: My VSLive Orlando Editing Master and Detail Records in ASP.NET 2.0 Session

    I got back from VSLive Orlando a few days ago - it was great! If you attended one of my presentations, I thank you and hope you enjoyed it/them. I had a great time talking to several attendees, speakers and the conference coordinators (they did a great job) at VSLive including. One thing I love about presenting at conferences is that I get to meet really interesting and great people. 

    I presented 2 different topics this time (see the agenda here). For those of you looking for my code samples from my Editing Master and Detail Records in ASP.NET 2.0 session, you can download them from these 3 links:

    Note: I included the northwind database script for SQL Server 2005 since it is not shipped with the product. I think its great that we have new and more involved sample databases, but a lot of demos still work on Northwind, so it might come in handy for you.

    Disclaimer: This code was written with VS.NET 2005's Release Candidate.

    Here is the abstract from this session:

    Editing Master and Detail Records in ASP.NET 2.0
    The ASP.NET 2.0 GridView and DetailsView controls add tremendous value to developers who need to create editable web forms with master detail data. These controls reduce the amount of code required to page, sort and handle many events that formerly required custom event handlers. This session will demonstrate how to migrate code to these controls from the ASP.NET 1.x DataGrid in a mutli tier application. The demos include examples on using the ObjectDataSource, SqlDataSource, Generics, the GridView, the DetailsView, Binding to Custom Business Objects, and Binding to ADO.NET DataTables.

  • Upstate NY User Group - ADO.NET 2 Presentation

    If you are going to be in the Albany, NY area on Tuesday, Nov 8th, stop by at 6:30pm at the Tech Valley .NET User Group meeting. I'll be presenting and demonstrating the enhancements to ADO.NET 2 using the latest release candidate bits.

    You can find a map and directions here (from Google Maps). The event is being held at Applied Underwriters 5 Maxwell Drive, Clifton Park, NY, 12065.

     

    Here is the presentation's abstract:

    Data access using ADO.NET is at the core of most .NET enterprise applications. While ADO.NET 1.x is powerful, its successor ADO.NET 2 contains several new features that are can benefit an application. We'll review these new features and how to take advantage of them including binary serialization of DataSets, new indexing performance features, enhancements to the DataTable, using the new ASP.NET data source objects to bind to DataSets or custom classes, and batch updates.

    • Performance
    • DataTable Enhancements
    • DataTableReader
    • Loading Data
    • Changing RowState
    • Batch Updates
    • Invoking Stored Procedures
    • Invoking Parameterized queries
    • DataSources (primarily ObjectDataSource)

     

    Posted Oct 18 2005, 12:40 PM by John Papa with no comments
    Filed under: ,
  • Check out Enterprise Library for .NET 2.0

    Tom Hollander, Ron Jacobs and Scott Densmore are presenting a webcast on what's coming the release of Ent Lib for .NET 2 this coming Thursday, 20th October at 2pm US Eastern Standard Time (18:00 UTC). It should be an interesting webcast to see how Ent Lib is evolving. These guys are very sharp and I find them to be good presenters

    Here is the description for the webcast, taken verbatum from the webcast site:

    Enterprise Library for Microsoft .NET 1.x has been a smashing success with two releases and over 150K downloads. The June 2005 release is compatible with Microsoft .NET Framework 2.0, but many of you are eagerly awaiting this next release of Enterprise Library which is specifically designed for .NET 2.0. In this webcast, we discuss how Enterprise Library has evolved to a true .NET 2.0 library.

    Posted Oct 17 2005, 12:04 AM by John Papa with 1 comment(s)
    Filed under:
  • DataSet and the DataTable in ADO.NET 2

    The November 2005 issue of MSDN Magazine is now posted online. My latest Data Points column outlines the evolution of the DataSet and the DataTable in ADO.NET 2.

    You can read the article online here.

     

    In the upcoming issues I'll be getting into some more of ADO.NET 2's new features, a follow up article on system.transactions, and some of the T-SQL enhancements in SQL Server 2005.

  • Store My Connection String Please - ConfigurationManager in .NET 2.0

    I love the neat little features. You know, the ones that aren't earth shattering but still get you excited over the simplicity involved. To me, the .NET 2.0 Framework's System.Configuration namespace's ConfigurationManager class qualifies as one of those things. Specifically, I like the ConfigurationManager's ConnectionString property. Here is a simple example ... I can create a connection string section in my class library project's App.config file and then access the connection string through code. Yeah, there are other ways to do it but this is just cool. Its simple. Its clean.

    Here is a sample App.config:

    <?xml version="1.0" encoding="utf-8" ?>

    <configuration>

       <connectionStrings>

          <add name="MyCnString"

          connectionString="Data Source=legolas;Initial Catalog=Northwind;Integrated Security=True"

          providerName="System.Data.SqlClient"/>

       </connectionStrings>

    </configuration>

     

    Add a reference to the System.Configuration.dll and then add a using statement like this :

       using System.Configuration; 

     

    The code to grab the connection string could then look like this: 

       string cnString = ConfigurationManager.ConnectionStrings["MyCnString"].ConnectionString;
       SqlConnection cn = new SqlConnection(cnString);

    Again, nothing earth shattering but its nice to have a place to store your connection strings.
  • Looking at PromptSQL - Intellisense for T-SQL

    Recently Sahil posted about his use of PromptSQL, a relitvely inexpensive tool that provides intellisense for T-SQL. I totally agree with Sahil in that one area that has been lacking for way too long is intellisense in T-SQL. While I use enterprise manager and visual studio to cerate queries and manage my stored procedures, triggers, and functions I still enjoy cracking open an editor isntead of a designer to write and debug T-SQL. Far too often, however, I am faced with a new database on a new project and I have to rack my brain trying to figure out what the columns and the tables are called. Normally I try to print out a E/R diagram so I can post it on my wall, but sometimes that is not feasible. This is why I tried out PromptSQL.

    PromptSQL is $25, a nominal fee for a product like this IMO. Of course there is a trial version available for download, too. It works inside of Query Analyzer and Visual Studio.NET (in SQL files), requiring its own connection to the database for what I assume is to access the INFORMATION_SCHEMA views or the system tables.

    PromptSQL's options allow you to change the font and the size of the intellisense. It also allows you to manage the duration of the database connection that it maintains. Overall PromptSQL helped me with database schemas that were less familiar to me. I could see this being a valuable asset for a development team who are being assembled on a mostly constructed database. However, in databases that I have familiarty of the scehma I found PromptSQL to mostly get in the way. In these cases, I turned it off because I found that it can sometimes take a moment (a split second really) to pop up its list ... it may not sound like a lot of time but when you are typing a query quickly without pause, you don't want to be interupted (at least I don't). It could've been just on my PC that I found this slight sub second delay, so I recommend trying it in your situation to see how it responds. Overall, I like the tool, that is at least until Microsoft offers it as part of Visual Studio.NET (*hoping*). Do I give it a thumbs up? If you know your schema, you probably won't use this that much ... but if you are often in unfamilar database schemas and/or in a situation where you forget the column names of a table, PromptSQL is not a bad idea.

    Posted Oct 06 2005, 10:42 AM by John Papa with 4 comment(s)
    Filed under: ,
  • Tips on Presenting and Speaking

    The amount of good content in the Microsoft WebCasts is quite amazing. The conferences such as VSlive, Tech Ed, Code Camps and Dev Connections are great too. Of course there are the occasional duds, but overall there is a lot of good content in there. For me, what sets apart a good presentation is not only the content but also the effectiveness of the presenter. OK, we are all pretty geeked up and excited about VS.NET 2005. Now imagine Alan Greenspan presenting Generics or ADO.NET 2. Zzzzzzzzzzzzzzzzzzzzzzzzzzzzz See my point? Even the most awesome topics can lose their audience if the presenter is boring the crowd into a deep sleep.

    There are entire classes on being an effective speaker/presenter, but I'm just going to focus on a few things that are no brainers to me that I have seen a lot of quite recently.

    1. Look at your audience. Don't avoid eye contact and turn your back on them. This is an easy way to lose their attention.
    2. Don't sniff into the microphone. Yes. I have heard this recently by a well known and very competent developer/presenter. It really grossed me out enough to the point where I could not listen any more.
    3. Avoid saying "um". If you don't know what to say, say nothing. A short pause is fine.
    4. Avoid long pauses. If you are waiting for code to run (often the case), make sure you have something pertinent to talk about to fill in the time.
    5. Don't make off color jokes. You really don't want stand in front of 100 people in a room and make an inappropriate joke (or worse, have it recorded). I've seen it and it can turn ugly..
  • Does Your App Need an Independent Data Layer ?

    Steve Joubert, a colleague of mine at ASPSOFT, recently had his article Does Your App Need an Independent Data Layer ? published. You can check it out online at the Simple Talk web site.

    Congratualtions Steve!

More Posts