LinQ to Entities on ADO.Net vs LinQ to SQL

Overview To make it short : LinQ to SQL only works with SQL Server but it’s working great. It’s simple, supports all LinQ operations and optimizes the generated SQL queries. LinQ to Entities on ADO.Net works with lots of database but it doesn’t behave like LinQ to SQL and doesn’t support some key LinQ features. Now the long story : For the last project I’ve been working on, we wanted to use LinQ and still be able to switch to one database to an other (MSSQL to MySQL for instance). So we decided we would use LinQ to entity. The generated object are roughly the same, the code to Create/Read/Update/Delete data is roughly the same. So we were quite happy. ...

October 4, 2009 · Florent Clairambault

Inside Sharepoint

I recently took the time to take a look inside the Microsoft.Sharepoint.dll using reflector. I’m not sure I have the right to do that. And I’m pretty sure I don’t have the right to publish any code extracted from it, so I won’t show any. Using SPSite(s) and SPWeb(s) If you do some timing on the SPWeb creation call (SPSite.OpenWeb), you will find out that it’s freaking fast (less then 1 ms on my server). The reason is that the most heavy object, the SPRequest class, is shared among SPWebs of a SPSite. The Dispose call only “Invalidate” the SPWeb, and if this SPWeb is the owner of the SPRequest (which is SPContext.Current.Web object in most of the cases), it releases it. ...

August 4, 2009 · Florent Clairambault

Mono Tools for Visual Studio : I have tested it !

Yes, I have tested MonoVS with the version 0.2.2641 (on both client and server). I installed OpenSuse 11.1 and added the MonoVS software repository, and everything worked ! I would have prefer to get it from SVN in order to use it in my Debian hosts but the mono development team seems to have removed it from their SVN repository. So, the Mono Remote Debugger for Visual Studio works, but there still some bugs. Deployment is super fast and it copies all the required DLL. ...

July 30, 2009 · Florent Clairambault

Sharepoint – Updating webparts

I’ve talked about this before. When you create versions of webparts, you have two main solutions to update existing webparts : Create a binding redirect within the web.config file. Update each and every webpart instance of the collection site (or just the site). The first one is really the best solution : It’s simple and very fast. But, it applies to the whole Web Application. Sometimes, the client might want to only update the site collection or even the website. In this case, we need to apply the second solution : update each webpart. ...

July 6, 2009 · Florent Clairambault

Access your Google Latitude position from a .Net app

When I saw that Google Latitude now enables you to access your data by a JSON feed, I decided to make it communicate with a little GPS tracking project of mine. I’m really found of all these ways we now have to make anything communicate with anything. You can build interfaces from any system to any other system really easily. This code enables you to automatically get your GPS position (or the position of a friend) from your JSON Latitude feed. To be able to do that, you have to enable your KML/JSON feed. ...

June 22, 2009 · Florent Clairambault

NetEventServer

I talked some time ago about a library I made to take advantage of the kernel network events. I now release it and explain how to use it. It can help people to do some little network software without knowing where to start from. I built it for network servers made to communicate with remotely connected embedded chips. I wanted to be able to always stay in touch with a huge number of chips without any real cost. So, my very personal goal was to built a server network layer for massive M2M applications. ...

June 17, 2009 · Florent Clairambault

C# 4.0

I tested it in VS2010. Which is beautiful by the way, I like the WPF rendering. And I’m happy they didn’t disable the possibility to generate .Net 2.0 assemblies. I wanted to test the new historical debugger functionnality, which enable you to see the state of variable in the past time, but I didn’t take the Team System Edition (and I’m too lazy to download it again). named and optionnal arguments ...

June 16, 2009 · Florent Clairambault

Sharepoint : The 0x80020009 (DISP_E_EXCEPTION) error

If you’re faced with that error, you should know that it doesn’t mean anything except you have a problem. Lots of people have written posts about it, but most of their explanations are wrong. It just means that sharepoint didn’t like what you did somewhere in your masterpage, your page, your webpart, your user control or anything else. For me, it was because I used the SPWeb.GetListFromUrl method to test if the user actually had access to a list. If it didn’t, I was just catching the exception thrown. ...

June 3, 2009 · Florent Clairambault

Lighttpd + Mono ASP.Net : The right configuration

As I already told before, I love the Mono project. It enables to run the powerful Microsoft .Net Framework on UNIX/Linux/BSD systems. I recently wanted to test a very cool feature of ASP.Net on a mono server. So I did a little apt-get install lighttpd mono-fastcgi-server2 -y The feature I wanted to try was a web scripting method ( with the [WebMethod] attribute) exporting some JSON directly from your method return value. ...

May 18, 2009 · Florent Clairambault

SharePoint: What Should I Dispose?

When starting with SharePoint development, a common question is “Which objects should I dispose?”. This is crucial because SharePoint leaks approximately 1 MB of memory per undisposed IDisposable object. For components like menus, this can quickly add up to 10 MB per page load. While the MSDN documentation provides comprehensive guidance, here’s the quick answer: In your WebPart, dispose of all SPWeb and SPSite objects except: SPContext.Current.Site SPContext.Current.Web SPContext.Current.Site.RootWeb For Features, dispose of all SPWeb and SPSite objects except those provided in your “properties” variable. ...

February 17, 2009 · Florent Clairambault