叠加流日期时间 [英] stack over flow datetime

查看:59
本文介绍了叠加流日期时间的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好
我的sql 2008中的persiandate有问题
问题是:
我在表中为我的日期选择了sqldatatype datetime2
并且插入效果很好,但是当我选择一些记录时,我得到了堆栈溢出错误
我真的不知道该怎么办
请帮助
谢谢

Hi every body
I have a problem with my persiandate in my sql 2008
the problem is:
i choice the sqldatatype datetime2 for my date in the table
and the insertion works well but when i select some records i get the stack over flow error
i really do not know what should i do
plz help
thanks

推荐答案

// this is the function that get list of my table
public static List<buscosttable> SearchBusCost(BusCostTable myBusCost, DateTime fromdate, DateTime untildate)
{
LINQDataClassesDataContext dc = new LINQDataClassesDataContext();

IQueryable<buscosttable> dataQueryobj = (from buscost in dc.GetTable<buscosttable()>
                            where buscost.busid == myBusCost.busid
                                                    select buscost);

                dataQueryobj = dataQueryobj.Where(a => a.date.Date >= fromdate.Date);
                dataQueryobj = dataQueryobj.Where(a => a.date.Date <= untildate.Date);
                return (from a in dataQueryobj.ToList<BusCostTable>()
                        select a).ToList<BusCostTable>();
}


// or if i write this again get me same error 
from a in table
where buscost.id == mybuscost.id & buscost.date.Date >= fromdate.Date & buscost.date.Date <= untildate.Date


//my datetime is persiandate such as 1391/6/28
at the range of the sqldate time is 1753.... and i change the variable to datetime2(7) and now the insertion works well  but the query does not
thanks alot</buscosttable></buscosttable>


这篇关于叠加流日期时间的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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