EF 4: Get Stored Procedures or View with System.NullReferenceException

Error: System.NullReferenceException: Object reference not set to an instance of an object.at System.Data.EntityKey.AddHashValue(Int32 hashCode, Object keyValue)at System.Data.EntityKey.GetHashCode()at System.Collections.Generic.GenericEqualityComparer`1.GetHashCode(T obj)at System.Collections.Generic.Dictionary`2.FindEntry(TKey key)at System.Collections.Generic.Dictionary`2.TryGetValue(TKey key, TValue& value)at System.Data.Objects.ObjectStateManager.TryGetEntityEntry(EntityKey key, EntityEntry& entry)at System.Data.Common.Internal.Materialization.Shaper.HandleEntityAppendOnly[TEntity](Func`2 constructEntityDelegate, EntityKey entityKey, EntitySet entitySet)at lambda_method(Closure , Shaper )at System.Data.Common.Internal.Materialization.Coordinator`1.ReadNextElement(Shaper shaper)at System.Data.Common.Internal.Materialization.Shaper`1.SimpleEnumerator.MoveNext() Problem: The Views/Stored Procedure was returning a null…

Continue Reading EF 4: Get Stored Procedures or View with System.NullReferenceException

Logging: Using Elmah, Nuget in ASP.NET MVC 3 and Oracle database

Logging is one of the most important thing you must to thinking about when intend to building a production website. There are many many way to implement logging in a website, and it was not able to easily. So in this article, I will simplify the way to implement logging…

Continue Reading Logging: Using Elmah, Nuget in ASP.NET MVC 3 and Oracle database

“ORA-01461: can bind a LONG value only for insert into a LONG column” error in NHibernate

“ORA-01461: can bind a LONG value only for insert into a LONG column” happen when try to insert large text (> 4000 Unicode characters) using NHibernate and Oracle. Following are steps work around to fix the problem: 1. Using Clob or NClob data type Normally we use VARCHAR2 or NVARCHAR2…

Continue Reading “ORA-01461: can bind a LONG value only for insert into a LONG column” error in NHibernate

NHibernate, LINQ and Oracle

Ngày nay, các lập trình viên đứng trong hoàn cảnh vừa khó lại vừa dễ để tiếp cận lập trình. Nếu như trước đây, khi chúng ta viết một chương trình dù là rất nhỏ thì số dòng code mà bạn phải viêt lên đến hàng nghìn, thậm chí hàng…

Continue Reading NHibernate, LINQ and Oracle