I am a newbie at C#.
I have a Textbox
and it is allowed to accept double_byte
string and it is used to input/show Date Value.
Now I am having a problem and I don't know how to solve this.I googled about it,and can't find any solution for it.
When I wrote Double_Byte
Characters( 2012/12/31) ,I want to change this value to (2012/12/31) at Leave_Event
of TextBox or Text_Changed
Event of this TextBox. So, How can I solve the problem.
Edit->My Solution is Window Application.
Thanks in advance.
Thank you for all of your answers and interests.
I searched a solution for this and not found any answer .Finally ,I got a nice answer from my colleague. Therefore, I share the answer of this problem.
When you send your text box value in database , parse it to Date.
Make sure that you are storing that text box'x value in database as DateTime datatype.
parsing can be done as follows>
Or simplest way use>>
Hope this will help you.
You should be able to use
Encoding.Default
to convert thedouble_byte
string to asingle_byte
stringTests:
Result: