June14

Just in Time Debugging CLR Procs

Example Debug Prompt This topic comes up frequently when users are writing CLR Procs and Triggers.  How do I debug the code that is being hosted by the database?

There is a very easy way to do it through the System.Diagnostics.Debugger namespace to launch the just in time debugger for Visual Studio.

Prompting the user for the debugger

You can prompt the user to attach a debugger at runtime using the System.Diagnostics.Debugger. You would NEVER want to do this at runtime in a production environment! Only for use on your development machines. I usually surround the block with an #IF DEBUG to ensure it gets compiled out at release time.

Notice the screen shot above, the user is prompted for which debugger to use.  The CLRProcSample is the correct project in this case because that is what I want to debug.

Notice that it shows all the editions of Visual Studio on my machine (2005, 2008, 2010) and all open projects.  This makes it really handy for debugging CLR Procs, Triggers, just about anything that might be hosted external to a process you control.

More...

June09

Building a Dynamic LINQ to Entities Compiler (Part 2)

In this article I will continue to explain how to build a dynamic LINQ to Entities compiler for any database provider that supports the Ado.net Entity Framework.  See part 1 of building a dynamic linq to entities compiler for background information. This part of the series will cover using the .Net CodeDom Compiler to dynamically execute LINQ queries against an EF model.

We are working on a dynamic LINQ query mechanism for the next major release of VistaDB.  Our goal is to provide a dynamic LINQ execution panel (like LinqPad does for Linq to Sql) in Data Builder.  Users will be able to write LINQ to Entities queries against the database without having to first build an EF model.  We include a default data context object that can be used to write the queries the same way they will appear in your code.

VistaDB LINQ ScratchPad PrototypeAllow users to write a LINQ query

The first step needed in the process of compiling the query is to allow the user to supply me with the database and query they wish to execute. In this example the user must return their result set to a var named query and use the name “context” for the EF model context.

More...

May06

Help on Visual Studio 2010 Help

If you have used VS 2010’s help system you may have that feeling that some changes were not as fully thought as others.  The new HTML Help 3 format may seems like a great idea, it runs as a service like an IIS website that all help instances query through.  No more hitting F1 in three copies of Visual Studio and getting three copies of the complete help loaded into RAM.

But that browser experience for the help system seems missing something to me.  Maybe the index?  Maybe the ability to actually read rather than search?  It seems optimized quite well for searching the help, but not actually following a topic.  You can’t sync the table of contents and see what other articles are in the same section of the help.

I want to cover the built in help, the Help Powertool released by Microsoft, and the H3Viewer application from The Helpware Group that allows local viewing of the html 3 help files (although Microsoft insists on calling them Help 1.0 Files).

F1 Help in VS 2010

Visual Studio 2010 Help Default Here is what I see when I hit F1 in Visual Studio 2010.  You get a system tray icon with the help service running and a browser window.

You have to already opted to install the help locally as a part of the install process, or you only talk to the remote servers at Microsoft. 

There was a bug in the beta versions that if the user selected non local help for the MSDN then ALL help was non local (even if your company put some help locally the users couldn’t see it).  I hope that has been fixed, but have not had time to test it myself again yet.

More...

April12

VistaDB 4 and Visual Studio 2010

Visual Studio 2010 - Gen EF 4Yes, Visual Studio 2010 was released today to much fanfare in Las Vegas. 

We of course had to immediately download it (along with what must be some major percentage of MSDN subscribers) and give it a test. 

Use Build 14 or higher

VistaDB 4.0 Build 14 works great with the VS 2010 Release.  Versions prior to this should probably not be used as there were some changes we had to make in order to get everything to work with VS 2010 in the first place. 

I have run through all of our NUnit tests in both .Net 2 and .Net 4 and all of them work correctly.  The Visual Studio plugins work, and the Entity Framework provider seems to be working fine as well.  The screen shot above is me generating a .Net 4 EF model on our Tickets Database.  (Note you can use the Include Foreign Key Columns only if you are using .Net 4)

More...

March03

Visual Studio 2010 RC Update

Visual Studio 2010 RC came out a few weeks ago, and the current VistaDB 4 build 12 does not work.  Build 12 obviously came out before the RC, so it was never tested on that release.

Updating for 2010 RC

The next VistaDB 4.0 build will be updated for Visual Studio 2010 RC.  I was actually of two minds of this issue. If the final (really final) build is only a few weeks away maybe we should just wait for that build.  Microsoft has broken ADO.Net plugins, EF, and several other things we need in EVERY new build of Visual Studio 2010.

Beta 2 left a bad taste

When 2010 Beta 2 shipped we scrambled really hard to get an updated build that worked.  We literally dropped everything else to just focus on those issues for about a week.  My thinking at the time was that if we found errors and got the bugs in quickly to Microsoft they would be fixed for the final release.  We opened 10 tickets with Microsoft on Beta 2 – ALL of them were denied as “too late in cycle to be fixed”.

More...