Browse Blog Posts by Tags

Showing related tags and posts for the Blogs application. See all tags in the site
  • XML namespace prefix 'xmlns' is not defined

    When working with VB9 you may get this cryptic error : XML namespace prefix 'xmlns' is not defined If you are using only default namespaces you can fix this by including a definition for the xmlns as an Import statement or as an xmlns attribute on the XML literal. But if you are using prefixed...
    Posted to @ Head by bill on Sat, Nov 24 2007
    Filed under: Filed under: , , , ,
  • Cleaning up your XML literal namespaces

    If you use XML literals in your code, adding one to another: Dim e1 = <a:books></a:books> dim e2 = <a:book></a:book> e1.Add(e2) You will have the xmlns declaration repeated in each of the elements, when really it is only needed once per the document or outer element. The problem...
    Posted to @ Head by bill on Fri, Nov 23 2007
    Filed under: Filed under: , , , , ,
  • Bug in XML literals around the Imports keywords..

    In VB9, there's a bug when using XML literals with any type member that is a protected keyword. For example, given the following psuedo types, Class Doc Public Property [Imports]() As List( Of DocImports) End Class Class DocImports Public Property [Namespace]() As String End Class The following code...
    Posted to @ Head by bill on Tue, Nov 20 2007
    Filed under: Filed under: , , , , ,
  • VS 2008 is LIVE !!!

    Just spotted it on MSDN subscriber downloads. Enjoy :)
    Posted to @ Head by bill on Mon, Nov 19 2007
    Filed under: Filed under: , , , ,
  • Update on Snippet Editor

    I've finally given the Snippet Editor a major make over including a new look. To go with this, I've given it a new home on my web site: http://billmccarthy.com/Projects/Snippet_Editor And I've added a Snippets category to this blog for feedback, info etc. I'll update the web page with...
    Posted to @ Head by bill on Mon, Nov 12 2007
    Filed under: Filed under: , , , , , ,
  • Old error, new look !

    In playing with Windows.Forms in VS 2008, I got the same old error I use to get in VS 2005 sometimes: Type must be a type provided by the runtime. Parameter name: type The good news is it looks so much prettier in VS 2008. It's not fixed, but look, isn't it pretty ? So why is it that the phrase...
    Posted to @ Head by bill on Tue, Nov 6 2007
    Filed under: Filed under: , ,
  • Snippet Editor 2008 release

    I've updated the Snippet editor to work with Visual Studio 2008 and 2005 releases. Note this release requires .NET 3.5. Changes/fixes: Added 2008 product range to the list of products Fixed replacement of the install root variable for Visual Studio that was resulting in a double \ midway of file...
    Posted to @ Head by bill on Tue, Nov 6 2007
    Filed under: Filed under: , , , , ,
  • Oh so you want polymorphism ???

    I recall almost four years ago to this day, I was at the 2003 PDC in LA. On the last day of the conference, the head architects of different .NET languages got together and talked about language directions, generics and some of the "VS 2005" stream of things. There was a Q&A session at...
    Posted to @ Head by bill on Sun, Nov 4 2007
    Filed under: Filed under: , , , ,
  • Counting deck chairs on the titanic

    Paul Vick released some statistics in relation to VB , which for discussion sake I'll repeat here : Visual Basic is the #1 .NET language (as reported by Forrester Research) Visual Basic is the #1 downloaded and #1 registered Express Edition (topping the #2 position by 20%) Visual Basic is the #1...
    Posted to @ Head by bill on Fri, Nov 2 2007
    Filed under: Filed under: , , , , , , ,
  • Playing with Extensions and Expressions

    Expression trees allow you to walk through all the information about an expression. So you can use this to create a NameOf function similar to the one I outlined in my post on VB 10 thoughts (part 5) <Extension()> _ Function NameOf( Of T1)( ByVal obj As T1, ByVal fn As Expression( Of Func( Of T1...
    Posted to @ Head by bill on Wed, Oct 10 2007
    Filed under: Filed under: , , ,
  • Inline casting

    I wrote a couple of really simple extension methods, Cast, and TryCast, that allow me to write code such as sender.Cast(Of Control).Text = "hello world" <Extension()> _ Function Cast( Of T)( ByVal obj As Object ) As T Return DirectCast (obj, T) End Function <Extension()> _ Function...
    Posted to @ Head by bill on Mon, Oct 8 2007
    Filed under: Filed under: , ,
  • "Is" gets a new role in VB 2008

    Thanks to Julie's post , I decided to dig deeper into the depths of VB than any sane man should go. While playing with nullable dates in the query, I was wondering why I could get the number of orders with a null ShipDate. I tried: Dim query = From order In db.SalesOrderHeaders _ Where Not order...
    Posted to @ Head by bill on Thu, Sep 20 2007
    Filed under: Filed under: , , ,
  • C# defies logic

    C# has some interesting rules for operators on nullable types. Given: int? x ; int? y ; Laws of transitivity tells us that if x is equal to y, (x == y), then x<= y would be true too. Well not in C#. With this function: static void test(int? arg1, int? arg2) { Console.WriteLine("arg1 == arg2 returns...
    Posted to @ Head by bill on Thu, Sep 6 2007
    Filed under: Filed under: , , ,
  • Another Vb'er gets bit by Option Strict

    Was just reading Julie Lerman's blog and noticed the issue she had wouldn't have happened if Option Strict was on. This really highlights the problem of having implicit conversions occur at runtime.
    Posted to @ Head by bill on Fri, Aug 31 2007
    Filed under: Filed under: , , ,
  • Thoughts on Expression Trees

    I just finished writing an article about Expression Trees for Visual Studio Magazine (aka VBPJ ) and there seemed to be some "holes" that I think should be plugged. An expression tree is basically a descriptive way of representing a lambda function. The standard LINQ query operators (e.g Where...
    Posted to @ Head by bill on Wed, Aug 15 2007
    Filed under: Filed under: , , , ,
  • VB XML schema goodness

    VB9 provides intellisense support for XElement if you add the schema to the project and import the relevant namespaces. This is just awesome ! Earlier tonight I wanted a list of shortcuts for all the snippets so I added the snippet schema to the project and the namespace imports as default: Imports <xmlns...
    Posted to @ Head by bill on Sat, Aug 11 2007
    Filed under: Filed under: , , ,
  • quick fix for Beta 2 VB sample problems

    If you've installed the Beta 2 samples for VB Orcas 2008, then you will likely find the solutions don't open. Problem is they are marked as being for "Orcas" not "2008". This quick and dirty code will fix the problem: With My.Computer.FileSystem Dim samplesPath = .SpecialDirectories...
    Posted to @ Head by bill on Sun, Jul 29 2007
    Filed under: Filed under: , , ,
Page 1 of 1 (17 items)