SqlDateTime问题 [英] SqlDateTime issue
本文介绍了SqlDateTime问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
DateTime.Max对于sql类型来说太大了。 LS在发布到桌子之前不应该做〜修剪吗? 我们 可以从SL访问SqlDateTime类吗? tia
DateTime.Max too big for sql type. Should LS not do a ~Trim before posting to table? We have access to SqlDateTime class from SL? tia
推荐答案
Hi William,
Hi William,
这不是LightSwitch特有的问题。这是一个.NET到SQL的问题。我曾经不得不在WinForms&& ;; WPF。
This is not a LightSwitch-specific problem. It's a .NET to SQL problem. I used to have to deal with this in both WinForms & WPF.
我最终创建了一个扩展方法"DateTime.ToSqlTime"。将值按摩为SQL的可接受值。
I ended up creating an extension method "DateTime.ToSqlTime" that massaged the value into an acceptable one for SQL.
Yann
这篇关于SqlDateTime问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文