我如何存储MaskedEdit" /"到我的数据库字段? [英] how do I store the MaskedEdit "/" to my database field?

查看:46
本文介绍了我如何存储MaskedEdit" /"到我的数据库字段?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

hi
我正在使用ajaxToolkit:MaskedEditExtender

我需要存储我的日期格式99/99/9999

我需要存储斜杠/和我一起

我需要从右到左开始输入日期

只要我使用阿拉伯语hijiri日期我的日期应该存储到数据库在nvarchar(10)这种方式30/12/1435

请帮助

hi I'm using ajaxToolkit:MaskedEditExtender
I need to store my date this format 99/99/9999
I need to store the slash "/" with me
I need to start entering the date from right to left
As long as I'm using Arabic hijiri date my date should be store to the database in a nvarchar (10) this way 30/12/1435
Please help

推荐答案

以时间格式存储这些数据(DATE,in特别),而不是字符串。我们观察初学者的悲观趋势:尝试使用代表数据而不是数据的字符串;这是非常糟糕的,避免它。



-SA
Store this data in time formats (DATE, in particular), not as string. We observe the sad trend in the beginners: trying to work with strings representing data instead of data; this is very bad, avoid it.

—SA


谢谢你的建议

我正在使用阿拉伯语hijiri日期。每个国家/地区都有自己的日历计算。

因此,解决此问题的最佳做法是映射表,包含每个格里高利日期和等效的日期日期。然后在Gregorian中进行日期计算,并返回相应的Hijiri日期。

这就是我将Hijiri日期存储在nvarchar中的原因。
Thank you for the advice
I'm using Arabic hijiri date. And each country has it's own calendar calculation.
So, the best practice to solve this issue is mapping table, contains each Gregorian date and the equivalent Hijiri date. Then do your date calculations in Gregorian, and return with the equivalent Hijiri date.
That was the reason I store the Hijiri date in nvarchar.


我做到了在c#这种方式

i did it in c# this way
txtReportDate.Text.Substring(4,4) + "/" + txtReportDate.Text.Substring(2,2) + "/" + txtReportDate.Text.Substring(0,2);



可以使用MaskedEdit!

请帮助


could it be with MaskedEdit!
please help


这篇关于我如何存储MaskedEdit" /"到我的数据库字段?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆