Contents tagged with .net

  • How to use System.Web in a Console Application

    I’ve been bitten by this and have seen others run into it enough times that I thought I’d blog about it.  Let’s say you’re creating a new Console, WPF, or Windows Forms application in .NET 4.  You’re using Visual Studio 2010, and everything is going great until you get to the part where you wanted to make an HTTP request.  You know you can do this, you’ve done it before, heck, you might even be copying code straight out of MSDN that does what you need.  But it doesn’t compile.   If you try and add a reference to System.Web, you’ll find it’s not there: If you look closely, though, you’ll see at the top of the dialog it says “Filtered to: .NET Framework 4 Client … more

  • Announcing DevMavens

    This month marks the launch of a new site we’ve been working on to help recognize and support a number of influential bloggers in the .NET developer community.  Please help me welcome the initial members of the DevMavens!  These bloggers have been invited to be a part of this small but hopefully growing group based on their influence in the community, and the DevMavens site has been set up (using ASP.NET MVC, no less) specifically to provide a portal to reach these influentials.  It aggregates and displays their most recent blog and twitter entries, and will hopefully provide a useful, easily accessible view of these influentials for the community. We’re very … more

  • Whither NorthWind?

    The Ha recently wrote about his desire to get away from NorthWind and perhaps start some community driven effort to come up with something else, mainly, it seemed to me, for the sake of being something else.  I must humbly disagree with this, but feel free to correct me if I'm wrong here. The first stated requirement for NotNorthWind is this: Complex enough to be called Real World but simple enough that someone could "get it" in 5-10 minutes That alone is enough for me, as a presenter, to suggest that perhaps this is not a good idea.  I'm a big fan of packing as much content into my presentations as possible.  I like to move quickly and fill up the audience's brain as much … more

  • Use Unit Test Framework to Test Production DB Consistency

    For Lake Quincy Media's AdSignia Ad Server, I wanted to be able to ensure that the database had some internal logic rules checked periodically.  What kinds of rules?  Well, probably an example would be best.  Suffice to say up front, though, that we're talking about more than NOT NULL or enforcing referential integrity.  For example, part of the ad engine's job is to redirect requests to ads to their destination URL on the advertiser's page.  These URLs are stored in a field in the database.  Occasionally, through cut-and-paste, there would be newlines in the URL field, which would be difficult to detect visually, but which would cause the redirect to … more

  • Fall DevConnections Session Comments

    I've been speaking at the DevConnections conferences since Fall of 2001 and have really enjoyed the experience.  The speakers are a great group of people to hang out with, Shirley and Erik and Paul and the rest of the team put together a very well-organized event, and this last show was very impressive in terms of its attendance and breadth of content.  Over the years, the level of feedback speakers receive, in terms of how the evaluations turned in by attendees are handled, has steadily improved.  In the last couple of years, we've been given a very good summary of how the evaluations came in, and I thought (in keeping with my goal #1 from my last post) that I would share … more

  • Holiday Skins for .NET Controls

    As the end of year holiday season approaches, it's fairly common for some web sites and products to re-skin their logos and applications to make them a little more festive or seasonal.  Google has long been known for their creative variations of their logo in response to various holidays throughout the year.  This year, at least one .NET control vendor, DevExpress, has created a Holiday UI skin for Windows.This is an application-wide UI skin, which developers can use to instantly modify the look and feel of traditional Windows solutions to one which is styled in a Christmas/holiday theme.  Ray blogged about the new theme a couple of days ago, and already it's gotten … more

  • Learn VS 2008 and .NET 3.5

    Guy pointed out a great resource for learning the newly released Visual Studio 2008 for free: the Visual Studio 2008 and .NET Framework 3.5 Training Kit, from Microsoft.  To quote the site: The Visual Studio 2008 and .NET Framework 3.5 Training Kit includes presentations, hands-on labs, and demos. This content is designed to help you learn how to utilize the Visual Studio 2008 features and a variety of framework technologies including: LINQ, C# 3.0, Visual Basic 9, WCF, WF, WPF, ASP.NET AJAX, VSTO, CardSpace, SilverLight, Mobile and Application Lifecycle Management. I'm downloading it now, but it definitely sounds like it would be worthwhile.  72.8MB of goodness - at least that's … more

  • Developer Acronyms for 2007

    I've learned a few new acronyms this year and thought I'd start this post to let others share their favorites as well.  Some of these are new to me, and some are classics that I thought were worth including even though they certainly predate 2007.  Where possible I've included a link to find more information on the acronym/topic. AJAX - Asynchronous JavaScript and XML CAPTCHA - Completely Automated Public Turing test to tell Computers and Humans Apart (Carnegie Mellon) CI - Continuous Integration (see also CruiseControl.Net, Team Foundation Server 2008) DI - Dependency Injection (see also MSDN) DRY - Don't Repeat Yourself - aka Once and Only Once - no duplicate code … more

  • VS2008 Shipping November 2007

    It's official now - Microsoft has announced that it will ship Visual Studio 2008 and the .NET Framework 3.5 later his month, November 2007.  The announcement came earlier today at TechEd Developers in Barcelona, Spain.  I expect a similar announcement will be made this week during the keynotes for DevConnections.  You can read the whole announcement here (although it's just a more longwinded and marketingish way of saying what I just said). more

  • DevExpress TechSummit

    I'm in Vegas a few days early (before DevConnections) to attend DevExpress's TechSummit2007, where they've invited a bunch of MVPs, authors, speakers, etc. to come and learn more about their controls and tools.  Yesterday we saw some of what they're working toward in the WPF space, with some charts and grids that are not quite ready yet, but look like they will be pretty nice.  I'm not doing much with WPF at the moment, since I'm mainly holding out for Silverlight 1.1 and whatever subset of WPF it supports, but DevExpress is also working on (mainly planning and proof-of-concept given the early nature of Silverlight 1.1) some controls for that as well.Today … more

  • Check if Unique Constraint will be violated before Insert with LLBLGen

    I needed to determine if a unique constraint would be violated so that I could programmatically update the Name of a business object to make it unique today.  I use LLBLGen for this project's database layer, and I have a unique constraint (actually a unique index) set on the database.  In this case it covers two columns, an integer ID and a string Name, but the nice thing about LLBLGen is that it provides helper methods that generate the predicate needed.  The code required looked like this: public static bool CampaignNameInUse(int advertiserId, string campaignName){  using (DataAccessAdapter adapter = new DataAccessAdapter())  {    CampaignEntity … more

  • Limit Rows In DataTable or DataSet

    I wrote some quick and dirty ADO.NET code to go against an RSS feed instead of a flat XML file today.  In the process I had to figure a way to limit the number of rows returned by the function, which returns a DataTable.  The simplest method I found was this one, which uses the DataTable.Select() method.  Using this technique, you could also pass in a sort parameter (second parameter to Select()) which would let you grab the top N rows from the DataTable after sorting it on whichever column you wished (syntax for sortexpression is "column" which defaults to ascending or "column DESC" for descending).  And of course you can also do a filter, etc., but I didn't … more