Thursday, February 25, 2010

Replicate, Repeat one value in C#

string.Concat(System.Collections.ArrayList.Repeat("0", 66).ToArray());

Convert string to Decimal in C#

(Convert.ToInt32(clm.OutOfPocketAmount) >= 0 ? (Double.Parse((clm.OutOfPocketAmount.ToString().Substring(1))) / 100).ToString("F2") : clm.OutOfPocketAmount.ToString().Substring(0, 1) + (Double.Parse((clm.OutOfPocketAmount.ToString().Substring(1))) / 100).ToString("F2"))

Friday, February 12, 2010

cannot convert between unicode and non-unicode string data types, SSIS

SSIS error:

solution
http://www.mssqltips.com/tip.asp?tip=1393

#database side

1) change the column width in database table for the error coulumn.

#SSIS package side

1) Right click 'Flatfile editor' and select 'Advanced' editor
2) Go to 'Input & Output Properties'
3) Expand 'Flat File Source Output
4) Expand the 'Output columns'
5) Select Error column and change the length.

-- Yup, refresh you're OLEDB connection with updated table information.

ready to go...