LessThanDot Site Logo

LessThanDot

A decade of helpful technical content

This is an archive of the posts published to LessThanDot from 2008 to 2018, over a decade of useful content. While we're no longer adding new content, we still receive a lot of visitors and wanted to make sure the content didn't disappear forever.

Conditional formating in a DataGridView with databinding

When you databind your DataGridView to a List. Like this. First I create a class Person so I can bind to that. Watch the default constructor, it needs to make new elements, if that is what you want. Public Class Person Private _name As String Public Sub New() _name = "person1" End Sub Public Sub New(ByVal Name As String) _name = Name End Sub Public Property Name() As String Get Return _name End Get Set(ByVal value As String) _name = value End Set End Property End Class Then the DataGridView.

Read More...

How to script all stored procedures in a database

In the forums I frequent, the question of scripting all stored procedures in a database arises very often, the most recent encounter is in this MSDN thread script out many stored procedures at once? A few years ago, I asked this question myself in www.UniversalThread.com forum and Borislav Borissov helped me to come up with the following solution: set nocount on DECLARE @Test TABLE (Id INT IDENTITY(1,1), Code varchar(max)) INSERT INTO @Test (Code) SELECT 'IF object_ID(N''[' + schema_name(schema_id) + '].

Read More...

Finalbuilder, Nunit and the AppDomainUnloadedException

I was running into this error when running my Nunit-tests. Executing : C:Program FilesNUnit 2.5.2binnet-2.0nunit-console.exe With Command Line : TDB2009.View.Test.C.dll NUnit version 2.5.2.9222 Copyright © 2002-2009 Charlie Poole. Copyright © 2002-2004 James W. Newkirk, Michael C. Two, Alexei A. Vorontsov. Copyright © 2000-2002 Philip Craig. All Rights Reserved. Runtime Environment – OS Version: Microsoft Windows NT 5.1.2600 Service Pack 2 CLR Version: 2.0.50727.3068 ( Net 2.0.50727.3068 ) ProcessModel: Default DomainUsage: Single

Read More...

Finding SQL Server Support – Become an expert yourself

Can I help you? There are several levels of support for SQL Server. Putting these levels on paper and knowing which to choose for your own particular problem can be a task in itself at times. I hope the following definitions of four levels of support will help you in deciding where to turn to obtain the quickest solutions. Defining levels Books and BOL User groups /Posting questions Technical forums Twitter – Yes, twitter is a rapidly growing place for expert support Books and BOL can provide solutions to problems where you have the time to both research and take great care in formulating the exact details of the problem.

Read More...

SQL Saturday 33 – Charlotte, NC

This weekend was SQL Saturday #33 in Charlotte NC and also the first one I attended. It’s been a long weekend, but I wanted to get my thoughts down while they’re still fresh. Be warned, it’s been a long weekend, so my grammar and attempts to reign in my propensity for verbosity have both gone out the window. Background Sorry SQL Saturday? Tarwn and SQL? We have questions and we know how painful it is for you to write short blog posts…

Read More...

C# Dynamic Data Layer

Update: I added some code to handle DBNulls. With the upcoming release of .NET 4.0 we will be seeing the new dynamic type introduced. The dynamic type bypasses static type checking and is instead checked at run-time. It was introduced to improve interoperability with dynamic languages like IronPython as well as simplifying the usage COM APIs that return objects such as the Microsoft Office API. How can we take advantage of this in other areas?

Read More...

Turning Napkins to HTML With Napkee

A few months ago, I was lucky enough to try out Balsamiq mockups and review it in a blog post (Turn Any Computer into a Napkin). In January I saw a bit of chatter about a new tool called Napkee that was built to enable easy generation of a working user interface from a Balsamiq mockups layout. The tool works with both HTML and AIR/Flex outputs, I am really only interested in the HTML part, so if you are looking for info on how it works with AIR/Flex turn back now.

Read More...

Calculating Nth weekday in a month

How to calculate the Nth week day of a month? This will be useful in most of the Scheduling problems like Scheduling Jobs, Appointments etc. Let me demonstrate how we can achieve this: Let us take an example of say, 3rd Sunday in February, 2010 will come on 21st February, 2010. The solution to the above problem needs to satisfy 3 conditions. The date should be in the specified month and year.

Read More...

Do You Get A Benefit From Compressing Backups If You Already Have Compressed Data?

Do you benefit from compressed backups if your data is compressed already? This was a question that was asked recently; I thought that the question was interesting and decided to do some testing. Here is what we will do; we will create two databases with only one table. In one database we will use page level compression and in the other database we won’t use compression. After that we will backup each database twice, once with backup compression and once without backup compression.

Read More...

Choosing operating modes for mirroring over a WAN

To sync or async… Over the weekend on twitter, the topic of high availability over a Wide Area Network (WAN) came up. The limit of 140 characters doesn’t do this topic justice, so a follow up is a good idea. We’re going to focus on selecting an operating mode of mirroring that the business can handle then the mirror is spread over a WAN. This also came out of the conversations when synchronous mirroring (High Availability) was mentioned in a way of being over Asynchronous (High performance).

Read More...