Hi Hovik,
IMO if you work with DateTime it would be much better
Have a look at this ...
Code:
DateTime dt=new DateTime(1382,2,28);
CultureInfo MyCulture = new CultureInfo("fa-IR");//persian culture
TextBox1.Text=dt.ToString("yyyy/MM/dd",MyCulture);
although this culture wasnt installed in .NET properly!!!(it acts like en-US)
but as you see I use
yyyy/MM/dd for my pattern to simulate persian date
correcly...
for format string you can change your string variable like below
Code:
string m="13820228";
m=m.Insert(4,"/");
m=m.Insert(7,"/");
TextBox1.Text=m;
anyway as you see its better to use DateTime ...
(your date field in your datasource should be as a datetime type
instead nvarchar or ...)
HtH.
--------------------------------------------
Mehdi.:)