在.net中Oracle日期类型的处理

来源:互联网 发布:网络传销举报电话 编辑:程序博客网 时间:2024/04/29 22:18
<script type="text/javascript"><!--google_ad_client = "pub-2947489232296736";/* 728x15, 创建于 08-4-23MSDN */google_ad_slot = "3624277373";google_ad_width = 728;google_ad_height = 15;//--></script><script type="text/javascript"src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
<script type="text/javascript"><!--google_ad_client = "pub-2947489232296736";/* 160x600, 创建于 08-4-23MSDN */google_ad_slot = "4367022601";google_ad_width = 160;google_ad_height = 600;//--></script><script type="text/javascript"src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
.Iru562{display:none;}  刚接触Oracle数据库,发现Oracle中的日期类型很难处理,必须为如11-11月-2004,而且必须是汉字月,不知是什么原因,从数据库里读出来再更新日期不变的情况下也不能更新了,真是麻烦,还得转换类型,在网上查了很多帖子,也没有找到好的解决办法,看msdn找到一个类CultureInfo,就写了一个方法转换日期类型.

publicstringrqcl(stringrqz)
{
CultureInfoci=newCultureInfo("de-DE");
stringsz=System.Convert.ToDateTime(rqz).ToShortDateString();
DateTimedt=System.Convert.ToDateTime(sz);
stringrq=dt.ToString("d",ci).Insert(5,"月");
if(dt.Month>9)
{
}
else
{
rq=rq.Substring(0,3)+rq.Substring(4,rq.Length-4);

}
return(rq);
}
需要引用usingSystem.Globalization;

<script type="text/javascript"><!--google_ad_client = "pub-2947489232296736";/* 728x15, 创建于 08-4-23MSDN */google_ad_slot = "3624277373";google_ad_width = 728;google_ad_height = 15;//--></script><script type="text/javascript"src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
<script type="text/javascript"><!--google_ad_client = "pub-2947489232296736";/* 160x600, 创建于 08-4-23MSDN */google_ad_slot = "4367022601";google_ad_width = 160;google_ad_height = 600;//--></script><script type="text/javascript"src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
原创粉丝点击