星期三, 7月 25, 2012

What can I do to resolve a “Row not found or changed” Exception in LINQ to SQL on a SQL Server?

The query generates the following SQL: UPDATE [Sessions] SET [Is_Active] = @p0, [Disconnected] = @p1 WHERE 0 = 1 -- @p0: Input Boolean (Size = 0; Prec = 0; Scale = 0) [False] -- @p1: Input DateTime (Size = 0; Prec = 0; Scale = 0) [9/4/2008 5:12:02 PM] -- Context: SqlProvider(SqlCE) Model: AttributedMetaModel Build: 3.5.21022.8 The obvious problem is the WHERE 0=1, After the record was loaded, I've confirmed that all the properties in the "deviceSessionRecord" are correct to include the primary key. Also when catching the "ChangeConflictException" there is no additional information about why this failed. I've also confirmed that this exception get's thrown with exactly one record in the database (the record I'm attempting to update) I solved this error by redragging over a table from the server explorer to the designer and re-building. or change nullable value.

星期四, 7月 05, 2012

SQL資料庫用Windows認證出現:Cannot Generate SSPI Context Error

Cannot Generate SSPI Context Error @ SQL 遇到一個SQL問題。 經驗中,這鐵定是使用NT整合式認證連線SQL資料庫失敗所致。 只要調整時間將Client & Db一致即可. 或者用setspn的方式也可

星期五, 1月 13, 2012

ASP.net網頁出現URL-encoded form data is not valid的處理方法

HttpException (0x80004005): The URL-encoded form data is not valid 於web.config中加入
<appsettings>
<add key="aspnet:MaxHttpCollectionKeys" value="5000"></add>
</appsettings>
如果還超過則要將該值放大