Monday, February 27, 2012

Returning rows in random order from MS SQL Server

Have you ever needed to return rows from MS SQL Server in random order every time you execute query? Here is simple solution to achieve this.

select top 10 * from some_table order by newid();

Thursday, February 9, 2012

Sending emails from .NET to local folder

This is useful trick when you need to test email sending from your application without flooding your inbox.
It is enough to set up our mail settings in following way:

<configuration>
  <system.net>
    <mailSettings>
      <smtp deliveryMethod="SpecifiedPickupDirectory">
        <specifiedPickupDirectory pickupDirectoryLocation="Dir"/>
      </smtp>
     </mailSettings>
  </system.net>
</configuration>

Monday, February 6, 2012

Raven DB tutorials

Very nice series of tutorials about RavenDB by Piotr Kwapin.

  • Part 1 - Introduction and Basic Operations
  • Part 2 - Simple Querying

Definitely worth to see. Have a nice reading