.NET Framework 3.0 Final download

If you haven’t noticed yet.. .NET Framework 3.0 final has been released! That’s a bit surprising for me I didn’t expect it that early.

Read more and download it here: .NET Framework Developer Center

Windows Vista Retail Packshots

Microsoft today revealed the retail packaging for Windows Vista and Office 2007, the eagerly awaited new products to be made widely available in early 2007. The boxes boast a completely revised and redesigned packaging. Writing on the Windows Vista Team Blog, Nick White said:

“Designed to be user-friendly, the new packaging is a small, hard, plastic container that’s designed to protect the software inside for life-long use. It provides a convenient and attractive place for you to permanently store both discs and documentation.

The new design will provide the strength, dimensional stability and impact resistance required when packaging software today. Our plan is to extend this packaging style to other Microsoft products after the launch of Windows Vista and 2007 Office system.”

Here are the Packshots:

Vista Packshot

Looks pretty good I’d say! ;) More german info on Windows Vista here: Windows Vista

A well done blog

I recently came across a blog which is really nicely done. JohnnyCoder.com, a blog about C# and the .NET Framework with useful articles for better development.

I was wondering which kind of plugins Johnny is using and what he did to make his blog look like that. He made a public article out of it: The Making of Johnnycoder.com – definitely a nice read for bloggers powered by WordPress.

Cheers
Andreas

AJAX: Element ScriptManager is not a known element

If you moved from ATLAS to the new ASP.NET AJAX Beta1 you might encounter that kind of problem, all other controls are affected as well like Element ‘UpdatePanel’ is not a known element.

To get around this issue you have to change the tagPrefix in your web.config:
Old:

   <controls>
          <add tagPrefix="asp" namespace="Microsoft.Web.UI"
 assembly="Microsoft.Web.Extensions, Version=1.0.61025.0,
 Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
          <add tagPrefix="asp" namespace="Microsoft.Web.UI.Controls"
assembly="Microsoft.Web.Extensions, Version=1.0.61025.0,
Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
        </controls>

New:

   <controls>
          <add tagPrefix="ajax" namespace="Microsoft.Web.UI"
assembly="Microsoft.Web.Extensions, Version=1.0.61025.0, Culture=neutral,
 PublicKeyToken=31bf3856ad364e35"/>
          <add tagPrefix="ajax" namespace="Microsoft.Web.UI.Controls"
 assembly="Microsoft.Web.Extensions, Version=1.0.61025.0,
 Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
        </controls>

This works as a temporary fix, this issue will be addressed in the next release of ASP.NET AJAX Beta.

hth

ASP.NET Performance through early binding

Microsoft said, ASP.NET applications contain 40 to 70 percent less code than ASP `applications`. My little test shows that it’s true, ASP.NET is really faster. However, an exact statement on speed is difficult because it’s depending on many factors.

The point of success isn’t the compiling but the early binding. That can be shown in an easy loop. I’ve used a Dual AMD Opteron, 2GHZ, 4GB RAM on Windows 2003 Server / IIS 6.0 for that test, here’s the code:

In ASP:

<%
Dim b, a, start, end, count
count = 50000000
Response.Write("Loops: " & count & "<hr>")
start = now
for a = 1 to count
b = b + a
next
end = now
Response.Write("Start: " & start & "<br>")
Response.Write("End: " & end & "<br>")
Response.Write("Execution length: " & DateDiff("s",start,end))
%>

In ASP.NET 2.0 with late binding:

private void Page_Load(object sender, System.EventArgs e)
{
object b = null;
object a = null;
object start = null;
object end = null;
object count = null;
count = 50000000;
Response.Write("Loops: " + count.ToString() + "<hr");
start = DateTime.Now;
object tempFor1 = ;
for (a = 1; a <= count; a++)
{
b = b + a;
}
end = DateTime.Now;
Response.Write("Start: " + start.ToString() + "<br>");
Response.Write("End: " + end.ToString() + "<br>");
Response.Write("Execution length:
 " +  Microsoft.VisualBasic.DateAndTime.DateDiff("s", start,
 end, Microsoft.VisualBasic.FirstDayOfWeek.Sunday,
 Microsoft.VisualBasic.FirstWeekOfYear.Jan1));
}

And now in ASP.NET 2.0 with early binding:

Same like above but:
Int64 b, Int64 a, DateTime start;
DateTime end;
Int64 count;

Here are the results:

  • The ASP Code: 26 seconds
  • The ASP.NET 2.0 Code with late binding: 16 seconds
  • The ASP.NET 2.0 Code with early binding: < 1 second!

The result speaks for itself.

kick it on DotNetKicks.com

Atlas goes ASP.NET AJAX

Too bad. Microsoft said goodbye to Atlas and comes up with a *new* framework called ASP.NET AJAX. There are lots of new features and bugfixes within that beta release which comes in 3 pars:

  • The ASP.NET AJAX v1.0 “Core” download. This redist contains the features that will be fully supported by Microsoft Product Support, and which will have a standard 10 year Microsoft support license (24 hours a day, 7 days a week, 365 days a year). The download includes support for the core AJAX type-system, networking stack, component model, extender base classes, and the server-side functionality to integrate within ASP.NET (including the super-popular ScriptManager, UpdatePanel, and Timer controls).
  • The ASP.NET AJAX “Value-Add” CTP download. This redist contains the additional higher-level features that were in previous CTPs of “Atlas,” but which won’t be in the fully-supported 1.0 “core” redist. These features will continue to be community supported as we refine them further and incorporate more feedback. Over time we’ll continue to move features into the “core” download as we finalize features in this value-add package more.
  • The ASP.NET AJAX Control Toolkit. This project contains 28 free, really cool, AJAX-enabled controls that are built on top of the ASP.NET AJAX 1.0 “Core” download. The project is collaborative shared source and built by a combination of Microsoft and non-Microsoft developers, and you can join the community or just download it on CodePlex today.

Sounds nice but the thing which makes me a little bit angry is.. the old Atlas code has to be migrated. It took me about 5 hours to migrate four of my existing ASP.NET Atlas applications. Here’s the migration guide: Atlas Migration guide.

Let’s hope we’re working with somewhat more stable bits now, ASP.NET Ajax.

Windows Vista To ‘RTM’ Oct. 25

Microsoft could be ready to release Windows Vista to manufacturing as early as next week, a milestone that would signify the end of a protracted development process. It could also set the company on a course to launch the operating system at the huge International Consumer Electronics Show in Las Vegas, where Chairman Bill Gates is to deliver the opening keynote Jan. 7.

“9 Days Until Vista RTM!!!” read a scrolling electronic reader board in a building on Microsoft’s Redmond campus Monday. If the countdown is correct, it would mean Vista is to be released to manufacturing (RTM) on Oct. 25, earlier than analysts expected.

Other than to reiterate that Vista is on track, a Microsoft spokesman had no comment on the reader-board message, which was visible from the lobby of Building 9, where part of the Windows Vista team works.

Red Gate SQL Refactor Beta released

Red-Gate released a fantastic SQL Refactor Tool which helps you refactoring that horrible SQL Code you have to deal with on a daily basis.

SQL Refactor is an Add-In to Microsoft Management Studio. Therefore you must have Management Studio installed. SQL Refactor’s features are available from the Management Studio menus, which can access both SQL Server 2000 and SQL Server 2005. In this release of SQL Refactor you can use the following features:

  • SQL Lay Out reformats your T-SQL scripts. You can select this feature from the top level SQL Refactor menu. There are over 30 options to control this feature, these you can access from the top level SQL Refactor menu.
  • Smart Rename renames functions, views, stored procedures and tables, and updates all the references to these renamed objects. You can select this feature from the context menu in Management Studio’s Object Explorer.
  • Smart Rename parameters and columns renames parameters of stored procedures and functions, and columns of tables and views. You can select this feature from the context menu in Management Studio’s Object Explorer.
  • Table Split splits a table into two tables, and automatically rewrites the referencing stored procedures, views, and so on. You can also use this refactoring to introduce referential integrity tables. You can select this feature from the context menu in Management Studio’s Object Explorer.
  • Uppercase keywords turns keywords in your script or selection to uppercase.
  • Summarize Script provides you with an overview of your script. By highlighting items in this overview you can see the corresponding statements highlighted in your script.
  • Encapsulate as stored procedure turns your selection into a new stored procedure, and if requested, introduces a reference to it in your script.
  • Expand wildcards expands SELECT * statements to include a full list of columns in the select part.
  • Find unused variables and parameters shows you the variables and parameters in you script that are not used, or that are only assigned to.
  • Qualify Object Names modifies the script so that all object names are qualified. You can select this feature from the top level SQL Refactor menu.

Download it here: ftp://ftp.red-gate.com/sqlrefactorbeta/sqlrefactorsetup.exe

Great Job!

Gaming on Vista 10 to 15 Percent Slower than XP

Microsoft is reportedly telling it’s gaming industry associates that games will run 10-15% slower on their new operating system due to the new GUI implemented.

Vista’s new 3D desktop will constantly be draining the PC of video memory that games could make use of, so in actual fact many of your favourite games will probably run faster on Windows XP. Of course after Vista arrives new PCs and hardware will be built especially for Vista which will increase performance anyway.

In the end, that should be clear for everyone. Windows Vista will be heavily bloated and if you don’t plan on disabling all that shiny stuff you will suffer a significant performance loss. I will upgrade to Vista as soon as it’s out, however, I will buy new hardware, too, in fact a complete new custom PC. If my games still don’t run smooth, the shiny stuff gotta go.

When to use .NET inside SQL Server 2005

Some meaningful scenarios when to use .NET programming inside SQL Server 2005:

  • The developer is not very comfortable with T-SQL, an implementation with .NET seems to be easy and uncomplicated. After some tests the created elements don’t show any performance impacts.
  • The realization of T-SQL seems to be inadequately complex. Especially string manipulation and sequencing are not the strength of T-SQL. However, in .NET it’s rather easy by using existing methods and functions. It’s better to use .NET if it’s faster to develop but also faster or as good as T-SQL in performance.
  • The realization in T-SQL is not possible at all. .NET commands make functions possible which wouldn’t be equivalent to T-SQL. This is mostly the case when accessing external resources.

So in my opinion .NET in SQL Server 2005 is only a real alternative if you have to access external resources or have to deal with complex tasks. It’s still SQL Server 2005 and not .NET Application Server 2005 ;) .

ASP.NET: Update one table from another

Here’s how to update one table by selecting the values from another:

UPDATE C
SET C.Phone = O.[Tel],
C.Fax = O.[Fax]
FROM output$ O
          JOIN Contacts C
                   ON C.MemberId = O.MemberId

Maybe this saves someone time..

AJAX Activity Images

I found a pretty nice set of AJAX Activity Indicators here: http://www.napyfab.com/ajax-indicators/

One example would be this here:
AJAX Progress Bar

Saves some time in AJAX Development ;)

Enforce strong Passwords in ASP.NET

I’m finally back from vacation, expect some impressions of Gran Canaria in the near future. For now, here’s a little HowTo for enforcing strong passwords.

Regex is a good way to deal with password validation. If you want your users to choose strong passwords here’s how to do it:

This regular expression will enforce a password to be at least 8 characters and to be a mix of letters and numbers. Additionally they need to have at least one uppercase letter.

^(?=.{8,})(?=.*[a-z])(?=.*[A-Z])(?!.*\s).*$
“pAssword555” will be accepted.

Serverside implementation:

public static bool IsPasswordStrong(string password)
{
  return Regex.IsMatch(password, @"^(?=.{8,})(?=.*[a-z])(?=.*[A-Z])(?!.*\s).*$");
}

Clientside implementation:

<asp:TextBox runat="server" ID="PasswordBox" TextMode="password" />
<asp:RegularExpressionValidator runat="server"
ControlToValidate="PasswordBox"
ValidationExpression="(?=.{8,})[a-zA-Z]+[^a-zA-Z]+|[^a-zA-Z]+[a-zA-Z]+"
Display="Dynamic"
ErrorMessage="Password must be 8 chars long and has to contain letters and numbers." />

Simple and effective, enjoy!

On Vacation

I’m leaving for 2 weeks in a couple of hours, flying to Gran Canaria ;) . I will respond to all the e-mails as soon as I get back, thanks and have a good time!

Andreas

ASP.NET: Access Controls after using PostBackUrl

Whenever you execute a Cross Page Post-Back from one site to another by using

<asp:button PostBackUrl=“anotherpage.aspx" runat=“server"/>

be sure to set this on anotherpage.aspx to gain full access to the controls of the previous page:

<%@ PreviousPage VirtualPath=“previouspage.aspx" %>

Afer that, you can access the controls by using the Page.PreviousPage Property.

Example:

Textbox MyNewTextBox = PreviousPage.FindControl("PreviousPageTextBox");
Label1.Text = MyNewTextBox.Text;

Cheers!