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:

Technorati Profile

Technorati Profile

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.

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.

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.

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:

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

  • 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?

    %d bloggers like this: