faizan ahmad

Usually the things which were not a straight Google

  Home  |   Contact  |   Syndication    |   Login
  17 Posts | 0 Stories | 68 Comments | 0 Trackbacks

News

Archives

Post Categories

.NET

ASP.NET

July 2010 Entries

I ended up using the MS Excel objects to convert files from XLS to CSV . Converted CSV had comma "," as field separator. But, what if the a filed content has comma like "lastName,FirstName". Now if you use default .net split method to get the fileds of a row in csv file, it will treat "lastName,FirstName" as two fields. I ended up writing my own split method which will take care of the comma in fields: Private Function CustomSplit(ByVal sText As String,ByVal sSeparator As String) As String() Dim ......

Presumption/limitation: yearly holidays are stored in a table maximum 2 consecutive holidays Table structure: HOLIDAY_DATE (DATETIME),HOLIDAY_DESC (VARCHAR) DB Script : DECLARE @CurrentDay DATETIME DECLARE @LastWorkingDay DATETIME, @CurrentWeekDay INT SET @CurrentDay = CAST(CONVERT(VARCHAR, GETDATE(), 101) AS DATETIME) SET @LastWorkingDay = CAST(CONVERT(VARCHAR, GETDATE(), 101) AS DATETIME) DECLARE @DaysToLastWorkingDay INT SET @DaysToLastWorkingDay = 0 SET @LastWorkingDay = DATEADD(day, -1, @LastWorkingDay ......