March 2006 - Posts

The Dutch DevDays 2006 Day 2: SQL Server Error handling

It was an excellent second day at the dutch DevDays. That's also because I won a brand new PSP value pack! :)) Thanks to Global Knowledge!!

Today Bob Beauchemin gave an excellent presentation about error handling in SQL Server 2005. Finally SQL Server has a better exception handling with the new try and the catch block. But wait, it is not what you might expect. When you handle the error with a try and a catch block. The client will never see the error number and the error message. That is because you handled the error. During the presentation Bob explained how to rethrow the original exception (error number+message) to the client. So that the client could see the actual exception. But the error number still cannot be retrieved from the error stack. That also means that the client cannot depend on an error number!

A short summary of the presentation:

  • You cannot handle errors in user defined functions;
  • Either all of the transactions will be committed, or all of them will be rolled back;
  • Use the keyword XACT_STATES to check the transaction status. 1 = Transaction in progress, 0 = No transaction, -1 = This is a doomed transaction;
  • Use SQLContext.Pipe.ExecuteAndSend(cmd)  to execute and get the most of the exceptions;
  • If you write SQLCLR code, just forget @@Error! Because the @@Error always have the value zero;
  • Best practice handling exceptions: Use SQlCLR, Use a try and a catch block, handle the error and raise the error. In your .net code use SQLError instead of SQLException;
  • For a doomed transaction. If you want to log some information in a log table for instance, first rollback the transaction and then log the information. Otherwise the statement will be terminated before you want to log something.
Posted by Chi Wai Man | 1 comment(s)
Filed under: ,

The Dutch DevDays 2006 Day 1

How was day one? Well sometimes I got bored because I already saw some technologies they had shown before. For instance: the Windows Vista demo and the C# generics stuff.  Besides that I had a wonderfull time.

My goodies so far:

  • Two free exam vouchers for upgrading my MCAD to MCPD! Cool man!  The vouchers will be expired at 12/31/2006.
  • I bought a MS press book: Working with MS VS.NET 2005 TEAM SYSTEM  with 20% discount:) 

 

Here are my reviews about the sessions I attended.

Session: 1 11:00-12:15 : Overview of WinFX

The keynote was 10-15minutes longer than expected. So I missed some of the WinFX presentation. Martin Tirion spoke about Windows Communication Foundation, Windows Workflow Foundation and the Windows Presentation Foundation.  I liked the demo's about Windows Presentation Foundation a lot. Now I can finally programming some cool animations in just a few minutes. There will be three new Microsoft Products to create some cool Stuff. The names of the products are: Microsoft Expression Designer, Microsoft Interactive Designer and the last product I forgot. And guess what? WPF is using DirectX under the hood!

Lunch session: 12:30 - 13:15 Next Generation Refactoring

Mark Miller rocks:) He really showed off with the next generation refactoring tool called Refactor! Before the presentation I had never heard about this product.

  • Supports VS.NET 2003 and 2005;
  • Refactor your code with the least amount of keystrokes;
  • No modal dialogs;
  • Preview the code before refactoring;
  • Context sensitve refactoring;
  • Some inline animation with blue and red arrows to indicate the input and output flow of a function. This shows the dependency of the data related to the function call;
  • No rename outside the class yet. They are still working on it.

Session 2: 13:30 - 14:45 SQL Server 2005- enabled features in data access

The room was packed with a lot of people. Some of them didn't had a place to sit. It was warm and I almost fell asleep couple of times;).  At first I was not planning to go to this session. But I changed my mind about this. Why? Ehh I thought the information might come in handy. But this session was not what I expected.  I expected some code demos and some of the new features in SQL Server 2005. But none of these where shown.

Bob Beauchemin  spoke about SQL Native Client. This is actually the new driver which incorporate  OLEDB, ODBC and the new JDBC. Correct me if i'm wrong. Microsoft rewrote JDBC because the previous driver still has some bugs. This driver was written by a third party.

If you want to use the new SQL Server 2005 features with OLEDB, ODBC of JDBC. Use SQL Native Client. And if you don't care about the new features. You can still use older drivers. The next item I can remember was, the notification service. It works as follows, Create a notification procedure in SQl Server 2005, write a delegate in VS.NET in combination with a dependancy (or was it sql dependancy?) and attach it to the notification service.  The notification service can be used to update your asp.net cache. The notification will not tell you which rows are updated, deleted or  added. It only tells you that the information has changed. The notification service is best used for information that will not frequenly change.

Session 3: 15:00 - 16:15 Developing Interactive web applications with ATLAS

Scott Guthrie showed a lot of the functionality with the current release of ATLAS. Before you develop an ATLAS application you have to decide which kind of ATLAS application you want to build. A server of a client approach. The server approach needs lesser javascript and it depends more on the server. The client approach needs a lot of javascript but is more interactive.

  • Cool demos with the AJAX Content control. This control can be used to update only the information in the defined control.
  • Progress control. This control will be used for displaying an animated gif with a waiting text to show that the request is processing;
  • It is possible to trigger webservice with a ajax control;
  • It is possible to attach different kinds behaviours to AJAX controls;
  • Use user defined .net classes on the clientside with javascript!
  • Call webserver functions from the clientside with javascript;

Related information:  The atlas project and the Web developer Helper and Fiddler.

Session 4 16:30 - 17:45 Effective use of Generics in C#

I must say that this was the most boring session of the whole day. I thought it was an in depth session about the tricks, do and don'ts about generics. But instead this was just a introduction about Generics. How boring....

That's it for now.

 

Posted by Chi Wai Man | with no comments
Filed under: ,

Investigating Windows Vista Beta 2 (5308) Part 1

I installed Windows Vista Ultimate Edition Version 6.0 build 5308 just two days ago and I must say that this is quite a stable release. The performance of Beta 2 is a little better than Beta 1. The driver support is also much better now.

My following pc hardware are supported:

  • Onboard Nforce2:  The sound chip works after an update of the driver from the Device Manager.
  • Onboard Nforce2:  Networkcard NVIDIA nForce Networking Controller.
  • My Videocard X800XT PE is supported by the newest build in driver from ATI 25–1–2006. But I noticed that the fonts are a little vague. 

If you still have some hardware unrecognized, click on the question mark of the device. Right click and select : update driver. If it still doesn’t work. Try updating the devices in a different order. The only thing that is still unrecognized is a device called NTativrv01. Dunno what that is.

In the System and Maintence I found a tool called: Performance Rating and Tools. This tool gives your hardware a performance rating. As you can see, my processor pulls down my overall rating:(

  
Posted by Chi Wai Man | 10 comment(s)
Filed under:

C# Generics Links

Here are some links I found about C# Generics:

Some articles written bij Juval Lowy:

Posted by Chi Wai Man | with no comments
Filed under: