Saturday, September 23, 2006

BLINQ! Web-Application generated

BLINQ is a scaffolding tool, available from the ASP.NET Sandbox Platform.
In this post, I'll try to explain details about BLINQ, especially

  • the idea
  • architecture and code generation
  • the webforms
  • summary


With the command line tool BLINQ, you can generate a Web-Application on the basis of an exisiting database schema. The resulting application does allow managing the data: select, insert, update and deletes. The relations between the data are used for navigation purposes and for foreign-key lookups.

So the idea is not really idea, but powerful in combination with ASP.NET. Let's see....

BLINQ is an abbreviation for WeB Language INtegrated Query, according to the naming pattern BLOG (WeB LOG). LINQ, the upcomming technology for universal, next generation data access is responsible to query and save the data thru objects. More details about LINQ, you will find on Scott's Blog and inside the official Linq Project Page.

Architecture and Code Generation

(Click the image to enlarge)

Step 1:

BLINQ needs database schema metadata (what a surprise :-). With the LINQ May CTP, the command line tool SQLMetal is installed, which is internal used by BLINQ to generate the necessary information and general data access classes.

For example, you can call SQLMetal manually to get metadata as xml:

sqlmetal.exe /server:.\sql2k5 /database:northwind /xml:northwind.xml

The resulting file looks like this (this is just the fragment for the northwind category table):

An other way to call SQLMetal:

sqlmetal.exe /server:.\sql2k5 /database:northwind /xml:northwind.cs

The result is a complete data access via LINQ (here's an other fragment):

Step 2:

After generating the general data access thru SQLMetal, BLINQ does generate more specific methods to query and update the backend. These methods are located inside the file StaticMethods.cs. If you call BLINQ with the parameter /pageDataSource, this methods are generated direct into the code-beside files.

Step 3:

The last step: BLINQ does generate WebForms, according the meta informations. For each table inside the database, BLINQ does generate three forms:

  • TableName.aspx
    A list of all records (GridView) including sorting, paging, navigation, editing and deletes.

  • NewTableName.aspx
    A single record view (DetailView) to add new data.

  • TableNameDetail.aspx
    A single record view (DetailView) to edit the data.

As an other example, the northwind tables "Customers" and "Orders" (parent-child relation) are visualized here:

The resulting forms and navigation here (technical view):


Here you can see Order Detail WebForm, generated by Blinq:

BLINQ does profit from the new ASP.NET 2.0 components and mechanism:
  • Layout is styled via MasterPage and Theme
  • Navigation does use Menu Control and SiteMap
  • Breadcrump thru the SiteMapPath Control
  • List with the GridView Control
  • Single Record with the DetailView Control
  • Business Object are accessed thru ObjectDataSource
  • Page methods thru the new PageDataSource

This fact is great and brings the advantage, that we can use your existing skills and knowledge of ASP.NET to customize the generated forms. By just changing the theme a bit and by changing the Employee Dropdown Fields DisplayValue, you can get the following customized result:


The first BLINQ Preview is available since June 06.

Naturally, there are several features missing in the current version, e.g. :

  • No validation inside Grid- and DetailView (e.g. required fields, validator according data type)
  • No editors (e.g. for DateTime fields)
  • No Ajax Support
  • No Designer Support
  • Limited templating
  • "Just" SQLServer 2000, -2005, -2005 Express Support

Polita Paulus, THE BLINQ Developer, is an active poster at the BLINQ Forum. She is responsible for the GridView, DataView and FormView ASP.NET as well.

BLINQ is useful for

  • prototyping
  • web-based data-table administration
  • as a starting point for more complex application
  • learning ASP.NET 2.0

The combination "robust and complex Web Framework (= ASP.NET)" with "Code Generation" is powerful. I looking forward to the next release.

Thursday, September 21, 2006

MS AJAX Library and Personalization

Just wrote an article about howto use ASP.NET 2.0 Profile Services together with MS AJAX Library (aka Atlas Client-Framework) including Demo-Project.

Interested? -

Monday, September 18, 2006

Restoring VS.NET 2005 Smart Tags...

.. after installing the C# Language Service (LINQ Preview May 2006)? You see the Smart Tag, but as soon as you click on the down-arrow to get the wizard or option list, the Smart Tag just disapears? - Annoying!! Here is the fix:

XML Notepad - New Release

Nice litte Tool from Microsoft: XML Notepad. A slick and slim alternative to Altova XMLSpy or VS2005 XMLEditor.

It does support:
  • Browsing XML
  • Instant schema validation
  • Intellisense according XSD
  • Undo/Redo
  • much more
Design is documented, Source Code is included, Tool is written in C# 2.0 and does use intensively System.Xml.

To get the code up and running in VS 2005 Solution, do the following:
  • Open XmlNotePad.sln
  • Delete Projects not needed (reduce to the max :-)
    - I just use Projects "Application", "Help" and "XMLNotePad"
  • Delete reference to not existing *.snk file (thru Project-Properties, Signing, disable "Sign the assembly")
  • Add a reference to the libraries XmlDiffPatch.dll and XmlDiffPatch.View.dll to Project "XMLNotepad"
  • Set Project "Application" as Startup
  • Run
Now, the solution should run without trouble.

Saturday, September 16, 2006

Web Client Software Factory

Microsofts Pattern & Practices Team has released a first Version of Web Client Software Factory. A Version for Smart Clients does exist as well.

Guidance and best practices how-to implement Applications End-to-End. WCSF does/will use techniques like ASP.NET AJAX, WF.

Both Factories are in eary stages.