通过查询从SQL Server调用.Net C#函数时获取错误的值

编程入门 行业动态 更新时间:2024-10-28 06:23:42
本文介绍了通过查询从SQL Server调用.Net C#函数时获取错误的值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我迫切需要一些指导/帮助.

I desperately need some guidance/help.

我正在根据轮班时间计算两个日期之间的工作时间(每周5天,每周8小时).为了更好地理解,我举了下面的例子.

I'm calculating working hours between two dates depending on the workshift (5 day per week, 8 hours per week). For better understanding of the I'm giving following example.

开放日期:2009年6月18日

OpenDate: 18-Jun-2009

截止日期:2010年1月6日

CloseDate: 6-Jan-2010

可以通过此链接检查近似天数 www.timeanddate/date/duration.html

Can check the number of days for approximation from this link www.timeanddate/date/duration.html

上述天数将为203天,因此大约会有145天,而对于8个工作小时,总工作时间将为203天,即1160天,以分钟为单位为69,600.这是近似值

Number of Days for above days will 203, so roughly there will 145 days and for 8 working hours total working hours will 1160 for 203 days which in minutes are 69,600. This is approximate

现在让我解释一下我在做什么和正在得到什么.

Now let me explain what I'm doing and what i'm getting.

我在C#中创建了Assembly/DLL来进行工作时间的计算,当我在Visual Studio中对其进行测试时,它给出了正确的结果,即69,414分钟,这是正确的.

I created Assembly/DLL in C# to do the calculations of working hours, when I tested this in Visual Studio its gives correct results i.e 69,414 minutes, which is correct.

我已在SQL Server 2005上成功注册了该DLL.当我从SQL查询中为一条记录调用C#方法时,它给出的正确结果与我在VS中得到的结果相同,即69,414分钟.

I registered this DLL on SQL Server 2005 successfully. And when I invoke the C# method from SQL query for a single record it gives correct result same as i was getting in VS i.e 69,414 minutes.

但是当我用很多记录运行该查询时,它给我的价值是不同的,例如,一条带有上述日期的记录给了我83334分钟,这很奇怪,我不知道怎么了以及在哪里

But when I run this query withmany records it gives me different value, for example one record with above mentioned dates gives me 83,334 minutes and its strange i don't know whats wrong and where

两个值之间的差异为232小时,这是巨大的并超过其不可靠的值.所以这是一个问题,如果您需要更多信息,请告诉我.

Difference between two values is 232 hours which is huge and above its unreliable value. So this is issue if you need more info please let me know.

Quick将受到高度赞赏.

Quick will be highly appreciated.

亲切的问候.

Sohail.

推荐答案

Sohail,

Hi Sohail,

该论坛仅用于Visual Studio中的数据库开发工具. SQL Server论坛 可能会给 您会更快,更好地解决您的问题,因为这些论坛中有更多的专家针对此类问题进行

This forum is just for the database development tools in Visual Studio. TheSQL Server Forumswould probably give you a better and quicker response to your problem because there are more experts on this type of issue in those forums.

感谢您的理解.

更多推荐

通过查询从SQL Server调用.Net C#函数时获取错误的值

本文发布于:2023-11-07 22:18:12,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1567588.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:函数   错误   SQL   Server   Net

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!