Question: I need to store an CARD ID number in Database. So there is no calculation just a search of the ID and putting the value in Session as property in a class.

The is ID is always numeric and it's 12 positions.
e.g. 123456789012 and I would like to show on the screen in this format. 123.456.789.012 (every 3 digit a dot).

I tried a test and defined Decimal(12,0) in database and I have put this value in database: 555666777888

then I try to display on the screen I used this code (CardID is decimal):

```
  lblCardID.Text = ent.CardID.ToString("0:#,###")

```

but it shows on the screen like this: **555,666,77:7,888** 

where is the **colon (:)** coming from? 

question additional:
- What type shall use in MS SQL to store this value in Database. Decimal (12,0) or Nvarchar(12) ?

Answer: 
The colon is coming from the colon in your format string. The "0:" at the beginning of the format string is needed when you are using string.Format(), as a placeholder to identify which of the arguments to format, but not if you are using ToString() (since there's only one value being formatted).
If it's an ID number store it as a string datatype, you're not going to be doing sums on it, you also won't have problems losing any leading zeros. You could also then store the card id with the embedded dots, sorting out your formatting problems.