RSS

Blog posts tagged with 'ASP-NET'

Use of FluentValidation for creating a sophisticated data validation framework in ASP.NET MVC

Written by Lavish Kumar

written by Lavish Kumar

Data validation is quite critical when it comes to usability and data integrity of any software or application. It helps in improving the quality of the data as well as it ensures the data consistency. Data annotations is still one of the most popular ways to do model validation in ASP.NET MVC. But, a lot of developers and projects are leaning towards Fluent Validation library these days. Why? Well, Fluent Validation is quite versatile and offers advantages.
Learn about the open-source project that sets the tone on how to use Entity Framework (EF) Code-First approach

Written by Lavish Kumar

written by Lavish Kumar

Entity Framework (EF) is an Object Relational Mapper (ORM) that enables developers to work with relational data using domain-specific objects. In other words, it allows developers to access and store data in the database via an automated mechanism. Before we dive deep into the details of code-first approach, we should understand the transference in a way the modern applications are being developed. 
How to search records in a gridview without using stored procedures or SQL scripts

Written by Lavish Kumar

written by Lavish Kumar

A great way to search records on client-side without getting using stored procedures or SQL script just by using  jQuery and css stylesheets.

Usually, many developers make use of stored procedures or SQL scripts to perform search which is kind of a common approach. It includes number of steps such as: writing a long stored procedure, placing a text box on your page that will enable a user to type a search term, execute the stored procedure on the search button click and passing the types parameter to the stored procedure and the results are displayed.

How to fix "The handle is invalid. (Exception from HRESULT: 0x80070006 (E_HANDLE))"

Written by Lavish Kumar

written by Lavish Kumar

Solution for an error message saying:


Server Error in '/' Application.

The handle is invalid. (Exception from HRESULT: 0x80070006 (E_HANDLE))

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 

Exception Details: System.Runtime.InteropServices.COMException: The handle is invalid. (Exception from HRESULT: 0x80070006 (E_HANDLE))

Source Error: 

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace: 

[COMException (0x80070006): The handle is invalid. (Exception from HRESULT: 0x80070006 (E_HANDLE))]   System.Transactions.Transaction.JitSafeGetContextTransaction(ContextData contextData) +0   System.Transactions.Transaction.FastGetTransaction(TransactionScope currentScope, ContextData contextData, Transaction& contextTransaction) +169   System.Transactions.Transaction.get_Current() +121   System.Data.ProviderBase.DbConnectionPool.GetFromTransactedPool(Transaction& transaction) +15   System.Data.ProviderBase.DbConnectionPool.GetConnection(DbConnection owningObject) +147   System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection) +108   System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory) +126   System.Data.SqlClient.SqlConnection.Open() +125   System.Data.EntityClient.EntityConnection.OpenStoreConnectionIf(Boolean openCondition, DbConnection storeConnectionToOpen, DbConnection originalConnection, String exceptionCode, String attemptedOperation, Boolean& closeStoreConnectionOnFailure) +52