应用程序运行正常,但上载后无法获取数据 [英] Application run lacally fine but when uploaded then unable to get data

查看:112
本文介绍了应用程序运行正常,但上载后无法获取数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嘿... !!!

我面临一个独特的问题,即当我在本地运行我的应用程序时,一切正常.但是当我将我的应用程序上传到服务器上并通过url访问进行预订时,前端工作正常并且数据存储在数据库中,但是当我查看所有预订时,存储过程无法获取最新记录...

Sp在Date上有一个where子句.当我删除它,然后用新记录执行,但是用where子句不起作用... :(

将同一个应用程序上传到另一台服务器上,然后在具有日期过滤器的同一个SP上运行就很棒了...

无法理解问题出在哪里...

Hey...!!!

i am facing a unique issue i.e. when i run my application locally then every thing goes okay. but when i upload my app on server and access from url to do a booking then front end works fine and data stored in database but when i go to view my all booking then store procedure failed to get latest record...

Sp has a where clause on Date. when i remove it then exe okay with new record but with where clause its not working... :(

where as same app is uploaded on another server then it work awesome with same SP with date filter...

cant understand where is the problem...

推荐答案

听起来像是地区问题.您如何提供日期?如果已将其参数化,则应该没问题,但是日期格式在世界范围内会有所不同,并且会根据指定的区域设置"在计算机上进行解释.

如果您随时将其作为字符串传递,则将其格式设置为"yyyy-mm-dd hh:mm:ss"
Sounds like a region issue. How are you supplying the date? If it''s parameterised you shoud be ok, but date formats vary around the world and will be interpreted on the computer according to the Regional settings specified.

If at any point you are passing it as a string, format it such ''yyyy-mm-dd hh:mm:ss''


我认为您需要将日期格式设置为唯一的格式,因此,如果任何服务器已将其设置为不同的区域,或者其日期格式有所不同,那么您使用的话就会引起问题,就像面对一台服务器一样.


所以你可以这样...

如果您使用系统日期与SP进行比较,请使用原因.

首先将您的where引起日期转换为颗粒格式,例如"dd-mm-yyyy"或"dd/mm/yyyy"或其他任何内容

以及使用比较日期(系统日期)的另一端,还需要将其转换为用于转换何处原因日期的格式.
I think you need to format your date to a unique format so if any server has set to different region or its date format is some different then you use then it will cause issue same like you face one.


so you can do like this...

if you use a system date to compare with your SP where cause then use like this..


first of all convert your where cause date to particulate format like "dd-mm-yyyy" OR "dd/mm/yyyy" or any thing else

and other side where you use comparison date (System date) you need also to convert it to the same format you use to convert your where cause date.


这篇关于应用程序运行正常,但上载后无法获取数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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