Posts

Catch Database Exceptions - DbEntityValidationException - Entity Framework

Catch Database Exceptions - DbEntityValidationException - Entity Framework  (C#,.NET) When you developing .net application with C#, EntityFramework you may get " Validation failed for one or more entities " error sometimes. With this error you can't find exact error or entity field directly. you may have to do some extra work for that. I am using following simple code for simply find error field. This is straightforward and very very small code. We can catch our database exseptions Using  DbEntityValidationException (Under namespace System.Data.Entity.Validation)   in EntityFramework. Im using EntityFramework.6.x. It is also available in EntityFramework 5.x. In here i am writing my exceptions in to text file in my C: drive ( C:\Shared\Error.txt ) Remember you have to give proper permissions for C: drive if you want to write data into text file. I am here i am using this for simplicity and tutorial purpose. try { //Your database operations....

ASP.NET Identity With Oracle Database

Image
In this topic i will try to give you some idea about using ASP.NET identity with Oracle Database for our MVC applications. At the beginning, I have done some research about suing identity with Oracle DB. There few useful articles i found, but not with complete details. Today i will try to cover most of the steps in this article. Below script include identity tables for Oracle DB. You can find some scripts on the internet, but here my good friend (DB guy) at one of my work place, taught me to recreate those scripts in a better way for Oracle DB. You can run those scripts in your DB. (If you have any problems running this scripts, let me know in the comment section). CREATE TABLE incapp.AspNetRoles ( Id VARCHAR2(128) NOT NULL, Name VARCHAR2(256) NOT NULL ) pctfree 20 pctused 70 tablespace INCTBL; create unique index incapp.pk_aspnetroles on incapp.AspNetRoles ( id ) pctfree 10 tablespace incidx; alter table incapp.AspNetRoles add ( constraint pk_asp...

How to disable the Windows Server Password Complexity

Image
In this post i will explain how to turn off password complexity and about few other policy settings. Steps Search for server manager in windows start menu. Open Server Manager > Tools > Group Policy Management Then expand your domain forest. Under the Domains. Right click Default Domain Policy and Click Edit. Then it will open Group Policy Management Editor. Under Computer Configurations > Policies > windows settings > Security Settings > Account Settings. Select Password Policy.  Now you can see all the settings related to password policy in your Windows Server. For disable password complexity, just open Password must meet complexity requirements. Select Disabled > Apply > OK . Also you can read all the details related to each policy in Explain tab. After that you have to refresh the policy. For that open Command Prompt and type the following command: “ gpupdate /force ” > Hit Enter....

How To Publish Web API - Visual Studio

Image
In this post i will show you how to publish your Web API project in Visual studio Open your solution and select the Web API project. Right click on the project and select Publish. Then it will popup Publish Web  process. In here i will show you how to publish using custom profile Select Custom and enter Profile Name  Hit next.(Connection tab) Select publish method as File System. And provide file location as Target Location i'm using HOST folder in C: drive. Hit next (Settings tab). Select Configuration as Release (By default in Release) and hit next (Preview tab). Click Publish button to publish your Web API. You can see publishing process in output window in Visual Studio . After succeeded the process you can brows file location and find all the files that you need to host your application. Now you can use this files to host in IIS server. Just need do give file path to IIS  Enjoy. 

Create Custom Attribute - Active Directory

Image
In this post i will show you how to create custom attribute in Active Directory and assign in to User class   Before create custom attribute you need to log in to Server using Administrative login. Not regular admin it has to be  Schema Admin. Otherwise   all the option will be disabled.(If you need to add Schema Admin  privileges, follow below steps.) Log in to user as an Administrator. Open Server Manger. Then Tools > Active Directory Users and Computers. Then Select Your Domain > Users and select user.  Then right click on user > Properties  Select Member of tab in properties window  > Add > Advanced  And type  Schema Admin on start with common query. then hit find now button (below screenshot)                         Then Select Schema Admin on search result. Hit OK > then OK again. Now you can create or edit attribute properties. T...

Best way to Speedup your Windows PC Windows 7 / 8 / 8.1 / 10

Image
In this Post i will show you one of the best way to speedup your Windows PC There are/ many ways to increase you Windows PC performance. Clean junk files Fragment Cleaning Software Startup processes etc. But most of the people like programmers don't care about the visual effects of animation inside windows. There are lots of animations and visual effects that busy your memory.  I am also testing this and it improves my laptop performance. let's do it. Press Windows Key + X in your keyboard then it will show you a quick access menu then select "System" in that menu. It will open System details in your PC Click "Advanced system settings" in left side menu Then select "Advance" tab in the "System Properties" view and click Settings under Performance Then select "Adjust for best performance" Or you can select custom preference by selecting "Custom".  If you...

Easy Way to Format your Code Sample for publish in Blogs / Blogger

Image
In this post i will show you how to format your code for publish inside tour blog or blogger within few steps.  Copy your code Visit  http://codeformatter.blogspot.com/ Paste the code in editor Change formatting option as you want Click "Format Source Code" This it with create source code for your blog. Also you can see Preview of the Source code. Copy the Content of "Copy Formatted Source Code" text area. Go to your blog and paste it within your HTML code. For example i will use one of my blogger post Go to Edit View in your post and select HTML (as following image) It will show you the HTML code of your post. Then paste the code content to your HTML code as following image Some times when saving the HTML code blogger will popup conflicts errors in your code  You can click "Fix" in the message any blogger will fix the error automatically. Then save the post and preview your post. It will show you the formatted ...