Guy Barrette, Microsoft, Regional Director, Montreal, Canada, Visual Studio, .NET Expertise July 2008 - Posts - Guy Barrette

Guy Barrette

Microsoft Regional Director, Montreal, Canada

July 2008 - Posts

BIOS update blues

I recently wanted to upgrade the BIOS on one of my PCs and I used the ASUS BIOS update Windows utility. 

I downloaded the latest BIOS and update tool from the ASUS Website then launched the update process.  After a few seconds, the tool reported an error so I tried to flash the previous BIOS version (that I saved earlier) but with the same result.  I ended up bricking the motherboard.  I then went to my local MicroBytes store and the first question the technician asked me was if I did the update from Windows.  Looks like it's very common problem using the ASUS Windows tool.  Yeah, great!

ASUS_BIOS_Bart.jpg

 

Posted: Jul 31 2008, 12:25 PM by guybarrette | with no comments
Filed under:
DevTeach 2008 Montreal call for speakers ends today

If you were thinking about sending sessions abstracts fro DevTeach 2008 Montreal, hurry!  The cut off is today!

More info here:
http://www.devteach.com/TechChair.aspx

Posted: Jul 31 2008, 06:59 AM by guybarrette | with no comments
Filed under:
Upgraded to dasBlog 2.1

I just upgraded from dasBlog 1.9.7 to the latest version (2.1) and everything seams to work fine.  Here's how I did it:

  1. Downloaded the latest version from www.codeplex.com/dasblog
  2. Extracted the Zip file to a temp directory
  3. Copied everything over the existing folder except these sub folders: Content, SiteConfig, Logs & Themes

That's it!

 

Posted: Jul 29 2008, 07:08 PM by guybarrette | with 2 comment(s)
Filed under:
LINQ to SQL Dynamic Mapping

The problem
You have SQL Servers for each of your environments (development, test, pre-prod, production) and in each one, the table names are different.  In fact, it’s not the table names that are different but the schema names but since the schema name is part of the table name, it must be specified.
Ex : dev.ZeTable et prod.ZeTable

Easy to solve, right?  Just put the schema value in the config file and do a simple concatenation at runtime.  Well, it’s not as easy as it seams because the table name is stored in an attribute of the partial class generated by the LINQ to SQL designer and Microsoft didn’t provide a way or method to change it at runtime.

[Table(Name="dev.ZeTable")]
public partial class TheTable

Solution
The solution is to dynamically load at runtime a mapping specific for each environment.  Here’s how to do it:

Initial Mapping
Use the LINQ to SQL designer to create the initial mapping.  The .dbml file will act as the starting point for our specialized mappings.

SqlMetal
Next, use the SqlMetal.exe tool to generate a mapping file but instead of pointing the tool to the database and redo all our customization in XML, the trick is to point it to the .dbml file we created earlier using the LINQ to SQL designer.  This way, all our initial customizations are preserved.  Nice!

From the Visual Studio 2008 Command Prompt, invoque SqlMetal like this :
C:\>SqlMetal /map:"MyApp.PROD.map" "C:\Visual Studio 2008\Projects\MyDataClasses.dbml" /code:"test.cs"
Microsoft (R) Database Mapping Generator 2008 version 1.00.21022
for Microsoft (R) .NET Framework version 3.5
Copyright (C) Microsoft Corporation. All rights reserved.

SqlMetal.exe will generate a C# or VB class.  We won’t use it so you can delete it. 

Next, open the mapping file and change the name of the tables to reflect the right schema:
<Table Name="prod.ZeTable" Member="TheTables">

A good practice might be to include the schema name in the mapping file name:
Ex : MyApp.PROD.map

DataContext
Next, we need to dynamically load the mappings at runtime by specifying a connection string and the mapping info in the DataContext constructor.  The Microsoft’s documentation is located here :
http://msdn.microsoft.com/en-us/library/bb534562.aspx

You can store that info in the config file and load it dynamically:
  <appSettings>
    <add key="MyAppConnectionString" value=" MyAppDev" />
    <add key="MyAppLinqMappings" value="c:\MyApp.DEV.map" />
  </appSettings>
  <connectionStrings>
    <add name="MyAppDev"
      connectionString="Data Source=MyDevServer;Initial Catalog=MyDatabase;Integrated Security=True" providerName="System.Data.SqlClient" />
  </connectionStrings>

//Read the ConnectionStrings from the config file
TheConnectionString = ConfigurationManager.ConnectionStrings[ConfigurationManager.AppSettings.Get("MyAppConnectionString")].ConnectionString;

//Read the LINQ mapping and store it in memorySystem.Data.Linq.Mapping.XmlMappingSource
TheLinqMappings = System.Data.Linq.Mapping.XmlMappingSource.FromReader(XmlReader.Create(ConfigurationManager.AppSettings.Get("MyAppnLinqMappings")));

Next, feed the DataContext’s constructor :
TheDataClassesDataContext ctx = new TheDataClassesDataContext(TheConnectionString, TheLinqMappings)

That's it!

Posted: Jul 23 2008, 04:04 PM by guybarrette | with 7 comment(s)
Filed under:
Wireless Presentation Remote

I was looking to replace my old wireless presentation remote (PowerPoint clicker) so I asked presenter extraordinaire and PowerPoint guru Etienne "E.T." Tremblay for a recommendation.  He said that the best device on the market is the Logitech 2.4 GHz Cordless Presenter so I quickly ordered one from TigerDirect to use it for my talks in Paris.

Verdict: 2 thumbs up!

Here are a few features that I like:

  • No drivers
  • 50’ range
  • Responsive
  • The receiver is stored in the device
  • 5 minutes increment timer
  • Vibrates at T -10 minutes and when timer reaches 0
  • Not cluttered with dozen of buttons and features
  • Feels “right” in the hand with the buttons placed at the right place

http://www.logitech.com/index.cfm/notebook_products/presenters/devices/175&cl=us,en

 

Posted: Jul 23 2008, 07:15 AM by guybarrette | with 1 comment(s)
Filed under:
Podcasting in Paris

While in Paris for speaking at the Université du SI conference, Mario Cardinal and I went podcast crazy.  During the week, we recorded 8 podcasts with French MVPs and even a bonus one with a French software engineer working for Microsoft Ireland. 

GUILLAUME BELMAS, MVP Team System, Exakis
CLERET ARNAUD, MVP BizTalk, Exakis
GREGORY RENARD Regional Director & MVP ASP.NET, Wygwam
ERIC GROISE, Octo
MATTHIEU MEZIL, MVP C#, Winwise
FLORENT SANTIN, MVP Team System, Winwise
MICHEL PERFETTI, MVP C#, Winwise
FABRICE MARGUERIE, MVP C#, Metasapiens, author of Linq in Action
VINCENT VERGONJEANNE, Microsoft Ireland

The first one is already online.  Check for the others throughout the fall.
http://www.visualstudiotalkshow.com

BTW, a big Merci Beaucoup to each one of you.

 

Posted: Jul 22 2008, 09:25 PM by guybarrette | with no comments
Filed under:
Zune Originals

I was planning to get a Zune 80GB when I saw that Microsoft is offering free engraving (+ shipping) thru September 15th.  Being a Kraftwerk fan, I couldn't resist ordering this design:

http://zuneoriginals.net

 

Posted: Jul 22 2008, 08:59 PM by guybarrette | with no comments
Filed under:
Visual Studio Talk Show #78 is online (French)

Accueil

Eric Groise: L’avenir est aux technologies vectorielles

Nous discutons avec Eric Groise qu'il est temps de quitter le Win32, le monde des boutons et fenêtres carrés ou il y a trop de texte et pas assez de visuel. Mort au « bitmap » et vive le vectoriel.

Eric Groise est spécialisé sur les problématiques liées à l’utilisabilité des interfaces homme machine . Depuis plus de 10 ans, Eric aide les équipes de développement à améliorer les applications qu’ils produisent : architecture, technologies et interface homme machine. Convaincu qu’il reste un grand chemin à parcourir avant que les applications en entreprises atteignent l’ergonomie des applications Apple, il s’occupe du centre de compétence GUI d’OCTO Technology. Eric fut également Microsoft Regional Director pour avoir été parmi les premiers à supporter activement la plateforme .NET de laquelle il est toujours un fervent admirateur.

Télécharger l'émission

Si vous désirez un accès direct au fichier audio en format MP3 ou Windows Media (WMA), nous vous invitons à télécharger le fichier en utilisant un des boutons ci-dessous.

         

Si vous désirez utiliser le feed RSS pour télécharger l'émission, nous vous invitons à vous abonnez en utilisant le bouton ci-dessous.

Si vous désirez utiliser le répertoire iTunes Podcast pour télécharger l'émission, nous vous encourageons à vous abonnez en utilisant le bouton ci-dessous.

Posted: Jul 22 2008, 07:10 AM by guybarrette | with no comments
Filed under:
The Next Bubble?

Anyone interested in the business of social networking Websites should take a look at Technology Review Magazine's August issue.  It's a special issue about social networking and the future of the Web.  Being published by the MIT, you would expect more then just a list of cool social network sites à la PC World.  Well, the magazine deliver the goods.  Not only you get a good assessment of the current situation, you get to understand the business of it (or lack of).  They also explain what Facebook runs on.

BTW, you don't have to rush to your newsstand to get a copy because you can read it online for free.

So, will it burst?

Posted: Jul 22 2008, 07:08 AM by guybarrette | with 2 comment(s)
Filed under:
ALT.NET Canada

The first ALT.NET Canadian conference will take place on August 15-17 2008 in Calgary.

Check all the details here:
http://www.altnetconfcanada.com/home/index.castle

Posted: Jul 20 2008, 08:37 AM by guybarrette | with no comments
Filed under:
More Posts