Visual Basic Linq syntax

You might have noticed in my previous post that the Linq query started with From instead of Select. While I did prefer the syntax that started with Select, because of its similarities with SQL, this change makes a lot of sense. If we want a good IntelliSense behavior we need to tell the editor what we are working on before we do any work, just like we declare variables before we use them, and starting with Select means that the IDE has no idea what we are going to query so it cannot give us any help.   And with … Continue reading Visual Basic Linq syntax

DLinq and detecting database schema changes

Previously I stated that I dislike the separation between the code and the database schema. A first look at SqlMetal.exe, a utility that comes with DLinq suggested that it might ease the problems and guess what, it does 🙂   I created a small sample app and added the following command to the pre-build event: “c:\Program Files\LINQ Preview\Bin\SqlMetal.exe” /database:Northwind /code:”$(ProjectDir)Northwind.vb” /language:vb   Build the project to have the Northwind.vb file generated and include it in the project.   Next I added the following code:   Sub main()     Dim northwind AsNew Northwind(My.Settings.DataConnection)       ‘ Build a list cities with … Continue reading DLinq and detecting database schema changes

Don Box using Visual Basic

Now you don’t normally catch Don Box doing a lot of VB programming. Now he does, maybe Erik Meijer showed him the light.     Maurice de Beijer

DLinq and SqlMetal

One of the problems I am always having with database development is the gap between data and code. Sure it isn’t hard to move data from database to memory, manipulate it and move it back but what remains a drag is someone making schema changes to the database and only finding out at runtime that the classes no longer match the underlying database schema. Well there might me light at the end of the tunnel 🙂 One of the features of DLinq is a command line utility called SqlMetal. Using this tool you can generate the types required for DLinq … Continue reading DLinq and SqlMetal

WinFX Beta 2 is Released

If you, like me, are into playing with the latest toys you surely don’t want to miss the latest WinFX beta. And Microsoft has just release Beta 2 so hurry and download it 🙂     Maurice de Beijer

Visual Studio Tools for Office “v3” June CTP

If you do any work at all with Microsoft Office the Visual Studio Tools for Office add-on is must have. And just in case you have never done any work with it, you really need to take a look at the current version 2 of Visual Studio Tools for Office, it is seriously cool for writing small applications or a useful addition to larger projects.   Well anyway the development team is hard at work at the next version and have just release a CTP so we can start playing with it and giving them feedback on what we like and … Continue reading Visual Studio Tools for Office “v3” June CTP

Red Gate – SQL Prompt

Red Gate make some pretty cool tools for SQL Server. Now most of them cost some money, not a lot specially considering what you get but still they aren’t free.   Now they have a new add that provides IntelliSense for SQL commands. And not only the keywords but also the table, columns and pretty much everything you need. And it works with a host of environments: Query Analyzer, SQL Server 2005 Management Studio, Visual Studio 2005, Visual Studio .NET 2003, SQL Server 2000 Enterprise Manager and even UltraEdit32. And best of all, it is free until September 1st.     … Continue reading Red Gate – SQL Prompt

DebuggerDisplay Attribute

With version 1.* of the .NET framework you needed to override the ToString() function to get a useful display in the debugger watch window. While this still works as before it is not exactly an ideal way, after all the ToString() function can be called during other actions and isn’t meant for debugging purposes.   The primitive way of looking at a collection.   In version 2.0 of the .NET framework we have a better way of doing this and that is the DebuggerDisplay attribute. Using this attribute gives you quite a bit of control over how the debugger displays … Continue reading DebuggerDisplay Attribute

Changing constructor parameters

One of the things that is sort of hard to do is change the value of parameters to constructors in my classes. Take following, very simple example:   PublicClass BaseClass     PublicSubNew(ByVal param AsInteger)         Console.WriteLine(param)     EndSub EndClass   PublicClass DerivedClass     Inherits BaseClass       PublicSubNew(ByVal param AsInteger)         MyBase.New(param)     EndSub EndClass   Now if I want to change the value of param in the constructor in the DerivedClass I can’t simply add change it’s constructor to:   PublicSubNew(ByVal param AsInteger)     param = param + 1     MyBase.New(param) EndSub   This code won’t compile … Continue reading Changing constructor parameters

Software Developer Conference

If you are in the Netherlands a do any form of serious .NET development I expect you are here in Papendal for the annual SDC conference. If not you are surely missing one of the better events in the Netherlands this year. There are loads of excellent speakers and around 400 people attending this year.   Well we are just about to start so if you are here enjoy and have a fun and informative two days 🙂   Maurice de Beijer