null oid not supported Telerik OpenAccess

February 18, 2016 Leave a comment

Error : Null oid not supported 

Stack trace
[ArgumentException: null oid not supported]
at Telerik.OpenAccess.SPI.Backends.ThrowException(Exception e)
at OpenAccessRuntime.ExceptionWrapper.Throw()
at OpenAccessRuntime.common.StatesReturned.addImp(OID oid, State state, Boolean directFlag)
at OpenAccessRuntime.common.StatesReturned.add(OID key, State value_Renamed)
at OpenAccessRuntime.Relational.RelationalQueryResult.fetchManagedTypes(ApplicationContext context, Int32 fetchAmount, QueryResultContainer results)
at OpenAccessRuntime.Relational.RelationalQueryResult.fetchNextResultBatch(ApplicationContext context, QueryResultContainer results, Int32 fetchAmount)

 

Reason :

Its because of the there is an object where the id (Primary key) field contains a null.

if there is an entity having two fields set as Identity field. and one of the fields is purely unique (set a Primary Key in DB)  where as the other one is not so this kind of error raised by Telerik ORM.

Solution:

Telerik ORM is not supporting  ‘null’ values as part of the identity. Each member that makes up the identity of a class must have a non-null value. There is no workaround either to this problem.

Hope this help !

Order by Date Descending issue (Linq)

February 12, 2016 Leave a comment

Issue :

 Dim list As List(Of Eventlist) = (From d In EventList
 Order By d.Status Descending, d.StartDate Descending, 
 Select d).ToList()

It gives me the date ordered by month and day, but doesn’t take year into consideration. for example:

12/31/2009 
12/31/2008
12/30/2009
12/29/2009

Needs to be more like:

12/31/2009
12/30/2009
12/29/2009
12/28/2009

Solution :

 Dim list As List(Of Eventlist) = (From d In EventList
 Order By d.Status Descending, Year(d.StartDate) Descending, Month(d.StartDate) Descending, Day(d.StartDate) Descending
 Select d).ToList()


Hope it helps !

Opening project in Visual Studio fails due to nuget.targets not found error

January 22, 2016 Leave a comment

Problem:
I try to open project in Visual Studio and get all these nuget errors:

The imported project "C:\Twitterizer\.nuget\nuget.targets" was not found. 
Confirm that the path in the <Import> declaration is correct, and that the file 
exists on disk.

Solution:
Follow the following steps to resolve above error
  1. Install Nuget.
  2. Right click on the solution and select “Enable NuGet Package Restore”.
  3. Click Ok on the warning.
  4. Close and re-open the solution.
Hope this help!

AngularJS Form Validation – Disable Submit / Confirm Password Custom Directive

January 21, 2016 Leave a comment

Bootstrap collapse: Change display of icons and text

December 17, 2015 Leave a comment

To Change display of icons and text for bootstrap Collapse use following

http://jsfiddle.net/rahuladmin/s52h0sbj/

Hope this help !

Vertically centering Bootstrap modal window

December 16, 2015 Leave a comment

To open the bootstrap modal popup in the center of screen use following code

http://jsfiddle.net/rahuladmin/07y8y5fg/

 

Hope this help !

Disable click outside of bootstrap model area to close modal

December 11, 2015 Leave a comment

Hello Friends following is the solution to disable outside click of bootstrap modal area

If you opening the modal by js use following:

$('#myModal').modal({backdrop: 'static', keyboard: false}) 

Or 

You can define your modal behavior, defining data-keyboard and data-backdrop.

<div id="modal" class="modal hide fade in" data-keyboard="false" data-backdrop="static">
Hope this help !