跳到主要內容

entity framework在SQE Server 2005 / 2012之間變換環境的問題.

ASP.NET C#
MVC 4.0
Entity Framework 6.0


測試環境:SQL Server 2012
正式環境:SQL Server 2005

遇到問題:
在測試環境都沒問題。
但是程式移到正式環境後,只要用entity framework linq查詢到datetime格式就出現例外狀況!!!

解法如下:
Open your EDMX in a file editor (or “open with…” in Visual Studio and select XML Editor). At the top you will find the storage model and it has an attribute ProviderManifestToken. This has should have the value 2008. Change that to 2005, recompile and everything works.
NOTE: You'll have to do this every time you update the model from database.

來源網址:http://stackoverflow.com/questions/316422/using-sql-server-2008-and-sql-server-2005-and-date-time


留言

這個網誌中的熱門文章

[SQL]暫存資料表重覆確認(temp table)

在MS SQL Server下, 若要避開暫存資料表重覆建立的問題, 可以使用T-SQL語法判斷:OBJECT_ID('tempdb..#TEMP_TABLE_Name') 例如: IF OBJECT_ID('tempdb..#TEMP_TABLE') is not NULL DELETE FROM #TEMP_TABLE --暫存資料表已存在 ELSE Create TABLE #TEMP_TABLE(CITY NVARCHAR(255),TOWNS NVARCHAR(255)) --暫存資料表未存在

[不負責] 中華3G上網測試 by CHT9110

託YuMei的福 在CHT9110一上市我就跑去士林辦了 我很少那麼快就買3C用品 是因為公司網路政策,加上這台有GPS跟PDA的功能 就決定購入 這篇的重點在於3G上網的速度 其它的我就不多贅述 地點選了四個地方:台南安平。北縣鶯歌。北市內湖科學園區。北縣汐止 都是我最常使用網路的地方 以下是我的測試結果 測試方式很簡單,再請各位多指教 -------------------------------------------------------------------------------- 地點A.內湖 -- 瑞光路底某家全玻璃外牆的三樓.... 測速的網頁: http://www.hinet.net/support/testspeed.html 公司目前的速度:[ 864 K bps ](相當於 106 K bytes/sec ) 用3G連線上網的速度: 1st:[ 356 K bps ](相當於 44 K bytes/sec )           2nd:[ 644 K bps ](相當於 79 K bytes/sec )           3rd:[ 151 K bps ](相當於 19 K bytes/sec )           4th:[ 721 K bps ](相當於 88 K bytes/sec )           5th:[ 671 K bps ](相當於 82 K bytes/sec ) 結論:1.3G上網不穩 2.速度有感到比較慢 3.堪用 -------------------------------------------------------------------------------- 其餘的測試地點待續...