Posts

Showing posts from April, 2016

WPF Custom Dictionary

Image
adding custom dictionary in wpf  MainWoindow.xaml file code <Window x:Class="WpfApplication2.MainWindow"         xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"         xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"         xmlns:sys="clr-namespace:System;assembly=system"         Title="Custom Dictionaries Example">     <Grid Margin="0,0,0,-6">         <RichTextBox Name="RichTextBox1" HorizontalAlignment="Left" SpellCheck.IsEnabled="True" Height="77" Margin="31,8,0,0" VerticalAlignment="Top" Width="704">             <SpellCheck.CustomDictionaries>                 <sys:Uri>pack://application:,,,/dictionary.lex</sys:Uri>             </SpellCheck.CustomDictionaries>             <RichTextBox.ContextMenu>                 <ContextMenu></ContextMenu>       

What is the importance of EDMX file in Entity Framework

Image
ADO.NET entity is an ORM (object relational mapping) which creates a higher abstract object model over ADO.NET components. So rather than getting into dataset, datatables, command, and connection objects as shown in the below code, you work on higher level domain objects like customers, suppliers, etc. DataTable table = adoDs.Tables[ 0 ]; for ( int j = 0 ; j < table.Rows.Count; j++) { DataRow row = table.Rows[j]; // Get the values of the fields string CustomerName = ( string )row[ " Customername" ]; string CustomerCode = ( string )row[ " CustomerCode" ]; }   Benefits of using EF The main and the only benefit of EF is it auto-generates code for the Model (middle layer), Data Access Layer, and mapping code, thus reducing a lot of development time. The importance of EDMX file in Entity Framework    EDMX (Entity Data Model XML) is an XML file which contains all the mapping details of how your objects map

TRIGGER in sql server

 Trigger is a special kind of stored procedure that automatically executes when an event occurs in the database server. DML triggers execute when a user tries to modify data through a data manipulation language (DML) event. DML events are INSERT, UPDATE, or DELETE statements on a table or view. These triggers fire when any valid event is fired, regardless of whether or not any table rows are affected. For more information Types of DML Triggers AFTER trigger     AFTER triggers are executed after the action of the INSERT, UPDATE, MERGE, or DELETE statement is performed. AFTER triggers are never executed if a constraint violation occurs INSTEAD OF trigger     INSTEAD OF triggers override the standard actions of the triggering statement. Therefore, they can be used to perform error or value checking on one or more columns and the perform additional actions before insert, updating or deleting the row or rows. For example, when the value being updated in an hourly wage column in a payroll

About ASP.NET MVC

Image
The Model-View-Controller (MVC) architectural pattern separates an application into three main components: the model, the view, and the controller. The ASP.NET MVC framework provides an alternative to the ASP.NET Web Forms pattern for creating Web applications. The ASP.NET MVC framework is a lightweight, highly testable presentation framework that (as with Web Forms-based applications) is integrated with existing ASP.NET features, such as master pages and membership-based authentication. The MVC framework is defined in the System.Web.Mvc assembly. The MVC framework includes the following components:      Models. Model objects are the parts of the application that implement the logic for the application's data domain. Often, model objects retrieve and store model state in a database. For example, a Product object might retrieve information from a database, operate on it, and then write updated information back to a Products table in a SQL Server database.     Views. Views are the

Filters in ASP.NET MVC

In ASP.NET MVC, controllers define action methods that usually have a one-to-one relationship with possible user interactions Sometimes you want to perform logic either before an action method is called or after an action method runs. To support this, ASP.NET MVC provides filters. Filters are custom classes that provide both a declarative and programmatic means to add pre-action and post-action behavior to controller action methods. ASP.NET MVC Filter Types     Authorization filters . These implement IAuthorizationFilter and make security decisions about whether to execute an action method, such as performing authentication or validating properties of the request. The AuthorizeAttribute class and the RequireHttpsAttribute class are examples of an authorization filter. Authorization filters run before any other filter. public class CustomAuthorizationAttribute : FilterAttribute, IAuthorizationFilter {     void IAuthorizationFilter.OnAuthorization(AuthorizationContext filterContext)