# Monday, 12 June 2006

Just saw that Scott Mitchell, of 4guysfromrolla fame, announced that he's busy writing tutorials about working with data in ASP.NET 2.0. You can find the tutorials in the Learn section of the ASP.NET official site among other tutorials like videos's, starter kits, ... Be sure to check out the Working with data in ASP.NET 2.0 tutorials. They're also downloadable in pdf format in both VB.NET and C#.

Grz, Kris.

Monday, 12 June 2006 21:08:05 (GMT Daylight Time, UTC+01:00)  #    Disclaimer  |  Comments [0]  | 
# Saturday, 10 June 2006

Just read .NET Framework 3.0 at Somasegar's blog.

It's just rebranding of the name Microsoft pushed as WinFX, because behind the scenes it seems to be the same .NET 2.0 framework as we're having now, but with added value: Windows Presentation Foundation (WPF), Windows Communication Foundation (WCF), Windows Workflow Foundation (WF) and Windows CardSpace (WCS).

I'm already looking forward to .NET 4.0. Are you?

Update: another article by Brad Abrams is online too: Toward .NET Framework 3.0....

Grz, Kris.

Vista | WCF | WCS | WF | WPF
Saturday, 10 June 2006 08:14:10 (GMT Daylight Time, UTC+01:00)  #    Disclaimer  |  Comments [0]  | 
# Friday, 09 June 2006
Just found out Microsoft started with a Wiki: MSDN Wiki. They'll hope to get more examples form the community and by thus more information for other people. Sounds like a good idea but I guess it'll have to grow before it becomes succesfull.

Grz, Kris.

Friday, 09 June 2006 18:11:55 (GMT Daylight Time, UTC+01:00)  #    Disclaimer  |  Comments [0]  | 
# Wednesday, 07 June 2006

Thanks to the newly added service by Microsoft in Belgium, I was told that this service was already longer available for other countries, called MSDN Connection one can purchase every month a book of the month at a 40% discount. Today I bought those of May and June:

May:

$blank(www.microsoft.com/mspress/books/6522.asp,CLR via C# Second Edition)

June:

$blank(www.microsoft.com/MSPress/books/8377.asp,Programming Microsoft ASP.NET 2.0 Applications: Advanced Topics)

The weather's finally getting better in Belgium so I can relax and read some interesting stuff the next couple of weeks.

Grz, Kris.

Wednesday, 07 June 2006 18:11:02 (GMT Daylight Time, UTC+01:00)  #    Disclaimer  |  Comments [0]  | 
# Tuesday, 06 June 2006

Most people are getting aware of the new upcoming version of Office. There are already several resources available and I thought I'd list some:

Some videos: Channel 9 In the office
Some report by Forrester: Developers get ready for 2007 Office system
A quick introduction to the new UI of 2007 Office System: First look 2007 Office System
extension code samples, supplemental developer white papers: 2007 Office System Starter Kit: Enterprise Content Management Starter Kit

Grz, Kris.

Tuesday, 06 June 2006 20:02:40 (GMT Daylight Time, UTC+01:00)  #    Disclaimer  |  Comments [1]  | 

Anyone who knows me, knows that I like Star Wars. I was quite amused when I found out about this little flash movie: Store Wars.

Grz, Kris.

Tuesday, 06 June 2006 19:12:23 (GMT Daylight Time, UTC+01:00)  #    Disclaimer  |  Comments [0]  | 
# Monday, 05 June 2006

I read this kind of questions multiple times on the $blank(forums.asp.net,ASP.NET forums). Most of the time it's suggested that one can use one of the events of the grid control they're using to use the FindControl method to find a Label control in one of the template columns and add the current row number to its Text property. I also used to do it like that when I started with ASP.NET.

However it can be done easier, and in markup, without the use of events, and best of all, the grid controls(1) of ASP.NET support the technique.


Figure 1: The GridView, DataGrid, Repeater and DataList controls shown to present the technique.

If Figure 1 you can see that it also supports pagination, which is shown in the GridView control.

Code says more than words so here goes:

    1 <%@ Page Language="C#" %>

    2 

    3 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

    4 

    5 <script runat="server">

    6 

    7     protected void DataGrid1_PageIndexChanged(object source, DataGridPageChangedEventArgs e)

    8     {

    9         DataGrid1.CurrentPageIndex = e.NewPageIndex;

   10         DataGrid1.DataBind();

   11     }

   12 </script>

   13 

   14 <html xmlns="http://www.w3.org/1999/xhtml" >

   15 <head runat="server">

   16     <title>Autonumbering grid controls</title>

   17 </head>

   18 <body>

   19     <form id="form1" runat="server">

   20     <div>

   21         GridView</div>

   22         <asp:GridView ID="GridView1" runat="server" AllowPaging="True" AllowSorting="True"

   23             AutoGenerateColumns="False" DataSourceID="SqlDataSource1" PageSize="5">

   24             <Columns>

   25             <asp:TemplateField>

   26                 <ItemTemplate>

   27                     <%# Container.DataItemIndex + 1 %>

   28                 </ItemTemplate>

   29             </asp:TemplateField>

   30                 <asp:BoundField DataField="CategoryName" HeaderText="CategoryName" SortExpression="CategoryName" />

   31                 <asp:BoundField DataField="Description" HeaderText="Description" SortExpression="Description" />

   32             </Columns>

   33         </asp:GridView>

   34         <br />

   35         DataGrid

   36         <br />

   37         <asp:DataGrid runat="server" ID="DataGrid1" DataSourceID="SqlDataSource1" AllowPaging="True" OnPageIndexChanged="DataGrid1_PageIndexChanged" PageSize="5">

   38             <Columns>

   39                 <asp:TemplateColumn>

   40                     <ItemTemplate>

   41                         <%# Container.DataSetIndex + 1 %>

   42                     </ItemTemplate>

   43                 </asp:TemplateColumn>

   44             </Columns>

   45         </asp:DataGrid><br />

   46         Repeater<br />

   47         <asp:Repeater ID="Repeater1" runat="server" DataSourceID="SqlDataSource1">

   48             <ItemTemplate>

   49                 <span style="margin-right:20px;"><%# Container.ItemIndex + 1 %></span>

   50                 <span><%# Eval("CategoryName") %> <%# Eval("Description") %></span><br />

   51             </ItemTemplate>

   52         </asp:Repeater><br />

   53         DataList

   54         <br />

   55         <asp:DataList ID="DataList1" runat="server" DataSourceID="SqlDataSource1">

   56             <ItemTemplate>

   57                 <%# Container.ItemIndex + 1 %>

   58                 CategoryName:

   59                 <asp:Label ID="CategoryNameLabel" runat="server" Text='<%# Eval("CategoryName") %>'>

   60                 </asp:Label><br />

   61                 Description:

   62                 <asp:Label ID="DescriptionLabel" runat="server" Text='<%# Eval("Description") %>'>

   63                 </asp:Label><br />

   64                 <br />

   65             </ItemTemplate>

   66         </asp:DataList>

   67         <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:NorthwindConnectionString %>"

   68             SelectCommand="SELECT [CategoryName], [Description] FROM [Categories]"></asp:SqlDataSource>

   69     </form>

   70 </body>

   71 </html>

For simplicity I used the SqlDataSource control that ships with ASP.NET 2.0 and used the Northwind database (lines 67 - 68). The following lines are of importance: 27, 41, 49 and 57. The + 1 is added each time because of the zero based index.

As you can see, it's each time a very simple addition to the markup of the grid control you're using but it adds that nice extra touch of information that endusers like to see.

Grz, Kris.

(1): I tested it upon the GridView, DataGrid, DataList and Repeater controls.

kick it on DotNetKicks.com

Monday, 05 June 2006 15:27:28 (GMT Daylight Time, UTC+01:00)  #    Disclaimer  |  Comments [2]  | 
# Sunday, 04 June 2006

While reading through the blogs I'm subscribed to, for the ones interested I use RSSBandit, I found these interesting links(1) on the blog of Smetty's Soapbox.

On figure 1 you can clearly see that the forename Kris was quite popular in that time. On figure 2 you'll see that my last name van der Mast is most popular where I live. For the ones who know a bit about the geography of Belgium: I live in Essen which is at the top of the red colored part on the map.


Figure 1: Kris was quite a popular name when I was born in 1975.


Figure 2: van der Mast is most popular in the province of Antwerp.

Grz, Kris.

(1): Forename & Lastname.

Sunday, 04 June 2006 09:57:02 (GMT Daylight Time, UTC+01:00)  #    Disclaimer  |  Comments [0]  | 
# Saturday, 03 June 2006

Like most ASP.NET developers I also first installed SQL Express 2005 together with visual studio.net 2005. After a while however I decided to get it off my dev laptop and install the full blown SQL Server 2005 instead because I wanted to test against this database and because I also needed it for an internal course at work. Things went fine, I also played around with the aspnet_regsql tool to make a dedicated database for my ASP.NET 2.0 services like Membership. I even changed the default setting for the LocalSqlServer connection string in my machine.config file in order to not be forced to override that setting in each new webproject I created.

After a while I felt the urge to reïnstall SQL Express 2005 because I downloaded several example sites and starter kits. Although it's quite easy to attach a .mdf file to SQL Server 2005, you can read my blogpost about it here: Attaching a .mdf file when you don't have the .ldf file available.

The installation went smoothly, I could see the extra database in SQL Server Management Studio but when I wanted to add a new local database, ie SQL Express database, in the App_Data subfolder of a web project I got this error:

"Failed to generate a user instance of SQL Server due to a failure in starting the process for the user instance. The connection will be closed."

Huh?

Well I search around, gained some knowledge about the problem and thought I share it with you:

First you'll need to open up SQL Server Configuration Manager. Navigate to that in the menu like Microsoft SQL Server 2005 > Configuration tools > SQL Server Configuration Manager. Take a look at figure 1:


Figure 1: The SQL Server Configuration Manager tool.

Double click, or right click and choose Properties, of the selected line and you'll get the properties window which you can see in Figure 2:


Figure 2: The properties window

You'll need to make sure that the Local system is selected.

The second part of the solution's to delete the following folder on your hard drive: c:\Documents and Settings\[user]\Local Settings\Application Data\Microsoft\Microsoft SQL Server Data\SQLEXPRESS(1). This folder's used to store information and apparently it messes up the proper working of SQL Express.

Grz, Kris.

(1): http://forums.microsoft.com/msdn/showpost.aspx?postid=98346&siteid=1

Saturday, 03 June 2006 19:23:25 (GMT Daylight Time, UTC+01:00)  #    Disclaimer  |  Comments [2]  | 

Microsoft launched the download site for SQL Express with advanced services.

Overview:

Microsoft SQL Server 2005 Express Edition with Advanced Services (SQL Server Express) is a new, free, easy-to-use version of SQL Server Express that includes a new graphical management tool and powerful features for reporting and advanced text-based searches. SQL Server Express provides powerful and reliable data management tools and rich features, data protection, and fast performance. It is ideal for embedded application clients, light Web applications, and local data stores.

SQL Server Express with Advanced Services has all of the features in SQL Server 2005 Express Edition, plus you can:

  • Easily manage and administer SQL Server Express with a new easy-to-use graphical management tool -- SQL Server 2005 Management Studio Express (SSMSE).
  • Issue full-text queries against plain character-based data in SQL Server tables. Full-text queries can include words and phrases, or multiple forms of a word or phrase.
  • Run SQL Server Reporting Services reports on local relational data.

Free to download, free to deploy, and free to redistribute as an embedded part of an application, SQL Server Express with Advanced Services is the fast and easy way to develop and manage data-driven applications with powerful built-in reporting and full-text search functionality.

Grz, Kris.

Saturday, 03 June 2006 15:47:28 (GMT Daylight Time, UTC+01:00)  #    Disclaimer  |  Comments [0]  |