Saturday, June 30, 2007

RegEx for data generation in VSTS DBPro

One way to generate data in DB Dude is to use the Regular Expression generator, but using regular expressions can be intimidating...

There is a great post by gert with list of RegEx expressions.

You can find it here.

I'm using Google Apps for Domains

It took me long enough, but finally I'm using Google Apps For Domains.

I've started using their free service (2 GB Email. with your own domain name) and have moved all of my current emailing aliases into that email service.

As you probably know, the spam filtering is awesome and the search capabilities are, well, Googlishious. No more need to pay for hosting or spam filtering!

I like the email web interface but do not forget: I can access my emails with pop3 from outlook, so no problem getting a "hard copy" of my emails offline.

My Calendar also hosted at google, so I'm all set.

Technorati Tags: Tags:

Wednesday, June 27, 2007

New and better document management in Google Docs

Google docs looks amazing!



The new home page has a sidebar that lets you filter the documents by tag (renamed to folder in the interface), by type or by collaborator. You can now see all your files by default, not only the documents or spreadsheets active in the last 30 days.
The folders can now have descriptions and you can send a document to a folder by using drag and drop!


Google removed the option to sort the files by name or author, so the only available sort option is by date.


The search box includes an autocomplete feature for file names, folders, authors.

Sunday, June 24, 2007

How to run scripts from VSTS for DB Pro in Management studio?

Why output script from VSTS for Database pro failed to execute in Management Studio?

Database pro output scripts are valid t-sql syntax, but remember: Database pro uses SQLCMD to deploy databases.

How can you make it run?

In Management Studio you need to swap into SQLCMD mode.

  1. Tthrough the Query -> SQLCMD Mode menu.
  2. Click the red exclaimation icon in your toolbar.

Thursday, June 21, 2007

WCF performance - Is it really better?

MSDN introduce a Performance Comparison of Windows Communication Foundation (WCF) with Existing Distributed Communication Technologies.

The conclusion is that "WCF is 25%-50% faster than ASP.NET Web Services, and approximately 25% faster than .NET Remoting. Comparison with .NET Enterprise Service is load dependant, as in one case WCF is nearly 100% faster but in another scenario it is nearly 25% slower. For WSE 2.0/3.0 implementations, migrating them to WCF will obviously provide the most significant performance gains of almost 4x."

You can fine the entire comparison here.

Saturday, June 16, 2007

Microsoft eScrum Version 1.0 - now avaliable

Another Scrum template to try with Team Foundation Servere is avalable: eScrum,  from Microsoft, which  is a Web-based, end-to-end project management tool for Scrum built on the Microsoft Visual Studio Team Foundation Server platform.

You can download it from here.

ASP.NET AJAX Toolkit: new version available for download

I've just noticed there's a new release of the Ajax Toolkit control with several improvements. Scott Guthrie has a cool post on the new stuff in the toolkit.

You can get it from here.

Thursday, June 14, 2007

Save datagrid changes in the database

Once you want edit a recore, add new or deleted a recored in your data grid you may want to save it in the database.

How do we do it?

  1. Create UpdateCommand handler for the data grid
  2. Identify what DataGrid row was updated by getting the ItemIndex property of the row (Item object) passed in the event object. Then use the index value to get the corresponding value out of the grid's DataKeys collection:
    • string key = DataGrid1.DataKeys[e.Item.ItemIndex].ToString();
  3. Get the changed values out of the DataGrid row. How?
    • From the item passed in the event object, get the appropriate cell (zero-based) out of the Cells collection from the item passed in the event object. For example, the left-most column in the grid is Cells(0).
    • For each cell, get its Controls collection, which contains all the elements that appear in the cell.
    • Get the first (and only) control out of the collection — for this example, a TextBox control. To get the TextBox, declare a local variable of type TextBox and cast the object in the Controls collection to it.
    • Get the TextBox control's value (its Text property).
  4. Find the corresponding row in the data table. The dataset contains a special FindBy method — that locates a row by its primary key and returns a reference to it.
  5. Update the row by changing values in the row you located in Step 4.
  6. Send changes from the dataset to the database by calling the data adapter's Update method.
  7. Switch the current row in the grid out of editing mode.
  8. Data-bind the DataGrid control.

Code example:

private void myDataGrid_UpdateCommand(object source, System.Web.UI.WebControls.DataGridCommandEventArgs e)
string productName, productDescription;
// Gets the value of the key field of the row being updated
string key = myDataGrid.DataKeys[e.Item.ItemIndex].ToString();
// Gets get the value of the controls (textboxes) that the user
// updated.
// Each cell has a collection of controls. In this case, a TextBox control.
// The first column -- Cells(0) -- contains the Update and Cancel buttons.
TextBox tb;
// Gets the value the TextBox control in the third column
tb = (TextBox)(e.Item.Cells[2].Controls[0]);
productName = tb.Text;
// Gets the value the TextBox control in the fourth column
tb = (TextBox)(e.Item.Cells[3].Controls[0]);
productDescription = tb.Text;
// Finds the row in the dataset table that matches the
// one the user updated in the grid. This example uses a
// special Find method defined for the typed dataset, which
// returns a reference to the row.
dsProducts.CategoriesRow r;
r = dsProducts.Categories.FindByProductID(int.Parse(key));
// Updates the dataset table.
r.ProductName = productName;
r.ProductDescription = productDescription;
// Calls a SQL statement to update the database from the dataset
// Takes the DataGrid row out of editing mode
myDataGrid.EditItemIndex = -1;
// Refreshes the grid

For more information about DataSet updates, navigate to:

Sunday, June 10, 2007

We're Hiring!

We are hiring new ALM consultant and .NET team leader.

  • Application Lifecycle Management consultant

    • At least 3 years of experience in .NET
    • Team System knowledge - advantage
    • Project management knowledge - advantage
    • Presale knowledge - advantage

  • .NET team leader

    • At least 3 years of experience in .NET
    • At least 1 years of experience in .NET 2.0
    • Leading experience
    • High motivation
    • Self learning capabilities

    send your cv to: maor at srl dot co dot il

  • Wednesday, June 6, 2007

    Brent Carlson's Presentation

    My company, SRL, organized yesterday very interersting presentation which delivered by Mr. Brent Carlson, CTO and co-founder of LogicLibrary, on "New methodologies and governance in SOA implementation".
    The event focused on explaining how to avoid SOA becoming ABOS (A Bunch Of Services), by managing (governing) the process of creating those services and making sure the organization re-uses it's pre-existing resources.
    It is common known that we we need a solution that enables enterprises to understand what assets exist, where they’re located and how each fits into a company’s business and technical landscape.

    So, how can we satifty this need? ....Mr. Carlson introduced LogicLibrary's solution: Logidex application, with which the governing mentioned above can be done. It seems this is relevant to very large organizations, not medium and small companies.

    Maybe I didn't understand him well , but I had the feeling that Logidex sees TeamSystem only as Source Control repository and expect to get other inputs from other applications (Like defects management system etc.). I came back home very confused and I prommised my self to investigate this issue more deeply.

    Are you ready for 2008?

    Microsoft's best professionals in Team System, ASP.NET, Architecture, WCF, WF, SQL Server and more, open three days of concentrated courses. You can check the courses list here.

    I will be talking about VSTS for DB Professionals. You can read more about it here.

    R U Ready 2008?

    Sunday, June 3, 2007

    ASP.NET 2.0 - Web Site vs Web Application project

    A common question by developers is what project model should I use for application? Web Site project (which introduced with VS 2005) or Web Application project (which delivered as add-in for VS 2005 and built-in within VS 2005 SP1)?

    There is no thumb rule. Every project model has it's own advantages (and diss-advantages off course...). I hope this post will help you to understand better the differences between 2 of them.

    Web Application project model

    • Provides the same Web project semantics as Visual Studio .NET 2003 Web projects.
    • Has a project file (structure based on project files).
    • Build model - all code in the project is compiled into a single assembly.
    • Supports both IIS and the built-in ASP.NET Development Server.
    • Supports all the features of Visual Studio 2005 (refactoring, generics, etc.) and of ASP.NET 2.0 (master pages, membership and login, site navigation, themes, etc).
    • Using FrontPage Server Extensions (FPSE) are no longer a requirement.

    Web Site project model

    • No project file (Based on file system).
    • New compilation model.  (Read here or here for more details) and ...
    • Dynamic compilation and working on pages without building entire site on each page view.
    • Supports both IIS and the built-in ASP.NET Development Server.
    • Each page has it's own assembly.
    • Defferent code model.  (Read here for more details)

    Ok, all is great, but you want to create your web site now. Which model should you use?

    • You need to migrate large Visual Studio .NET 2003 applications to VS 2005? use the Web Application project.
    • You want to open and edit any directory as a Web project without creating a project file? use Web Site project.
    • You need to add pre-build and post-build steps during compilation? use Web Application project.
    • You need to build a Web application using multiple Web projects? use Web Application project.
    • You want to generate one assembly for each page? use Web Site project
    • You prefer dynamic compilation and working on pages without building entire site on each page view? use Web Site project
    • You prefer single-page code model to code-behind model? use Web Site project

    Saturday, June 2, 2007

    Secure your application

    Worried about security? Microsoft has published patterns & practices Security Checklists Index for .NET framework 1.1 & 2.0.

    You can find there:

    • Architecture and Design Review Checklists
    • Code Review Checklists
    • Deployment Review Checklists

    Take care...

    Friday, June 1, 2007

    Free Download: Refactor!™ for ASP.NET

    Refactor! for ASP.NET version 2.2 by Developer Express is freely available to all ASP.NET 2.0 developers.

    This release includes refactorings dedicated to ASP.NET development.

    Great tool!