Posts

Showing posts from 2017

A collection with cascade="all-delete-orphan" was no longer referenced by the owning entity instance

Ok, this exception "A collection with cascade="all-delete-orphan" was no longer referenced by the owning entity instance" can happen with NHibernate if you have an entity with a list of other entities with the .Cascade.AllDeleteOrphan() mapping. If you clear the list by assigning it a new List<entity>(), this exception will appear. Instead clear the list by using the .Clear() method. Error Code using( var session = _sessionManager.GetSession())         using (var transaction = session.BeginTransaction())         {             var order = repository.GetOrderEagerlyByOrderId(session, fromDb.Id);             var now = DateTime.Now;             const string user = "GNB\\Username";             var future = now.AddYears(1);             var taxType = new TaxType(0, "Code", "AlternateNameE", "AlternateNameF", "NameE", "NameF", "DescriptionE", "DescriptionF", 13, now, fu

Drop Down width increases automatically in IE 11

Add the onmousedown attribute and have it focus on the select dropdown so that it loses focus from the input box. For some reason focus on the input before accessing that select causes this error. <select onmousedown="$(this).focus()">

Cannot open database "" requested by the login. The login failed. Login failed for user 'IIS APPPOOL\'. after hosting on IIS

Image
Looks like it's failing trying to open a connection to SQL Server. You need to add a login to SQL Server for  IIS APPPOOL\ASP.NET v4.0  and grant permissions to the database. In SSMS, under the server, expand Security, then right click Logins and select "New Login...". In the New Login dialog, enter the app pool as the login name and click "OK". If you are using some custom app pool then give your app pool name.

Cannot open database "" requested by the login. The login fled. Login failed for user 'NT AUTHORITY\SYSTEM'. in mvc

Finally  I set the pool identity on LocalSystem and thought why it might be preventing "NT AUTHRITY\SYSTEM" from opening a connection to my database. I opened up SQL Server Management Studio as the user "Administrator" and checked out the  Server Roles  for NT AUTHORITY\SYSTEM under "logins" section. The default server role for this user was  public  by default.  I also checked sysadmin  and refreshed my web application form.

Error: $injector:unpr Unknown Provider

This error results from the  $injector  being unable to resolve a required dependency. To fix this, make sure the dependency is defined and spelled correctly. For example: angular . module ( 'myApp' , []) . controller ( 'MyController' , [ 'myService' , function ( myService ) { // Do something with myService }]);   The above code will fail with  $injector : unpr  if  myService  is not defined. For More visit  https://docs.angularjs.org/error/$injector/unpr

Route ' ' threw Exception System.InvalidOperationException: Error during serialization or deserialization using the JSON JavaScriptSerializer. The length of the string exceeds the value set on the maxJsonLength property.

Route ' ' threw Exception System.InvalidOperationException: Error during serialization or deserialization using the JSON JavaScriptSerializer. The length of the string exceeds the value set on the maxJsonLength property. Solution -  Working with JSON within Web Services recently has become the latest and greatest simply because it plays so nicely with others and can often be very easily serialized and deserialized to fit your needs. There is just something rewarding about having a massive collection of complex objects that can be throw into a simple string and passed across however you see fit and then completely regenerated in its original collection in just a handful of code. However sometimes these strings can get big and I mean really big, like exceeding default values big and when this happens, exceptions happen. This post will cover a few ways that you can prevent a nasty  InvalidOperationException  that may look something like this with ease : The Probl

TF203015: The item ' ' has an incompatible pending change.

Solution - Take latest version of that file in both branch then try to merge

Severity Code Description Project File Line Suppression State Error Unable to resolve dependencies. 'Xamarin.Android.Support.Design 24.2.1' is not compatible with 'Xamarin.Forms 2.3.3.180 constraint: Xamarin.Android.Support.Design (= 23.3.0)'. 0

Xamarin Forms is not always compatible with the latest version of the Google Support libraries. Xamarin publishes them so Android developers (not using Forms) can utilize them if they need them, but Forms developers can continue to use the older, compatible versions.

Fluent NHibernate “Could not resolve property”

So this error comes when your n-hibernate query is not proper sql query. For example your query is var riAlbum = session . QueryOver < Album >() . Where ( x => x . Name == albumName && x . Artist . Name == artist ) . List (). FirstOrDefault (); this query will convert into sql as below select Album .* from Album where Album . Name = 'SomeAlbumName' and Album . Artist . Name = 'SomeArtistName' so that is wrong as last line 'Album.Artist.Name' is not proper sql. so u have to apply join in your n-hibernate query. var riAlbum = session . QueryOver < Album >() . Where ( a => a . Name == albumName ) . JoinQueryOver ( a => a . Artist ) . Where ( ar => ar . Name == artistName ) . List () . FirstOrDefault ();