Luciano Evaristo Guerche

A brazilian geek interested in .NET technologies

About Me

Browse by Tags

All Tags » microsoft (RSS)
dbo.PartitionLeft, dbo.PartitionRight and dbo.Partition
IF EXISTS( SELECT * FROM dbo . sysobjects WHERE id = OBJECT_ID ( N'[dbo].[PartitionLeft]' ) AND xtype in ( N'FN' , N'IF' , N'TF' ) ) BEGIN DROP FUNCTION [dbo] . [PartitionLeft] END GO CREATE FUNCTION [dbo] . [PartitionLeft] ( @value bigint , @min bigint...
String.Format("My name is {0}", "Luciano Evaristo Guerche") (VB6)
A feature I loved in .NET (C# and VB.NET) is String.Format method. So I thought how I could have the same feature on VB6 and I came up with the following code. Public Function StringDotFormat( ByVal strFormat As String , ByVal ParamArray aryPlaceHolders...
Public Function IsValidCPF(ByVal strCPF As String) As Boolean
Option Explicit Public Function IsValidCPF( ByVal strCPF As String ) As Boolean Dim intDigito As Integer Dim intIndex As Integer Dim intModulo As Integer Dim intSoma1 As Integer Dim intSoma2 As Integer Dim intDigitoVerificador1 As Integer Dim intDigitoVerificador2...
CREATE FUNCTION dbo.IsValidCPF
IF EXISTS( SELECT * FROM dbo . sysobjects WHERE id = object_id ( N'[dbo].[IsValidCPF]' ) AND xtype in ( N'FN' , N'IF' , N'TF' ) ) BEGIN DROP FUNCTION [dbo] . [IsValidCPF] END GO CREATE FUNCTION dbo . IsValidCPF ( @CPF varchar ( 11 ) ) RETURNS bit AS BEGIN...
Renaming Microsoft Sourcesafe items through OLE automation
Today I had to rename a thousand items on Microsoft Sourcesafe just to conform to Enterprise Manager's item naming conventions. I would be out of luck, but fortunately Microsoft Sourcesafe allows OLE automation, so I created a new Visual Basic 6 project...
How to mimic Microsoft Access's FIRST and LAST clauses on SQL Server 2k, 7.0 and 6.5
Suppose I have the following query run against Pubs database SELECT employee . emp_id , employee . fname , employee . minit , employee . lname , employee . job_id , jobs . job_desc , employee . job_lvl , employee . pub_id , employee . hire_date FROM employee...
Microsoft Outlook OLE automation to bulk adjust email display name
I've just written code bellow to adjust email display name from my contacts on Personal Folders > Contacts > Plaxo Option Explicit Private Sub cmdExecute_Click() Dim blnDirty As Boolean Dim objOutlookApplication As Outlook.Application Dim objOutlookMAPIFolder...
ISNULL + NULLIF instead of CASE WHEN
Today I had to write a SQL statement quite similar to the sample below: SELECT ProductID, ProductName, CASE WHEN ProductDescription IS NULL OR ProductDescription = '' THEN '<no description>' ELSE ProductDescription END AS ProductDescription...
Microsoft Patterns & Practices Enterprise Library 1.0 - Where to download from?
It can be downloaded here: Microsoft Patterns & Practices Enterprise Library 1.0
Are blogs killing traditional ASP.NET sites?
While in my 'getting back into coding' frame of mind I've been surfing around looking at various sources of information - I've come to realise something that I missed before - there's a lot less 'high quality' information avaialble...
More Posts Next page »