Using Crystal Report in ASP.net MVC and creating generic report viewer

Download Project
This article describes how to show crystal report in ASP.net MVC.
Here I will describe two different ways for showing crystal report in MVC.
1. Showing crystal report using ASP.net web forms in MVC.
    A. In same window
    B. In different window
2. Showing crystal report from Controller/action (by generating PDF on fly).
    A. In same window
    B. In different window

Later I will describe how to create a generic/ common report viewer web form and generic/ common report viewer Controller class, which will be used for showing any Crystal report (with/ without data).

Continue reading

How to solve ” Could not load file or assembly ‘…’ or one of its dependencies. The parameter is incorrect. (Exception from HRESULT: 0×80070057″ Error

Last day I have faced an error when I am compiling my ASP.net MVC application and this is for illegal shutdown of my computer.

Here is my Error: ” Could not load file or assembly ‘EntityFramework’ or one of its dependencies. The parameter is incorrect. (Exception from HRESULT: 0×80070057 “

Similar types of Error:Could not load file or assembly ‘AjaxControlToolkit’ or one of its dependencies. The parameter is incorrect. (Exception from HRESULT: 0×80070057 “

Continue reading

Master Detail CRUD Operations using ASP.net MVC 3 and EF

Master Detail CRUD Operations using ASP.net MVC 3 and EF. Master detail in asp.net mvc

Introduction

In this post I will discuss about how we can perform Master Detail CRUD Operations using ASP.net MVC 3 and Entity Framework (Code First).  Here I have used JSON (json2.js)  for data passing, Ajax for posting and DataTables (datatables.js) for manipulating detail Record.

Continue reading

Saving change is not permitted MS SQL 2008/ SQL 2008 R2

By default saving changes on a table is is blocked. When we want to change or alter any Table Then it shows following message

Saving change is not permitted. the changes you have made require the following tables to be dropped and re-created. You have either made changes to a table that cant be re-created or enabled the option Prevent Saving changes that require the table to be re-created.

We can fix it following way

Continue reading

Selecting Record from XML Valued Column in MS SQL

Just Consider we have following records in a object named CR_NonDPC_ConfigDTO

PCName : PC
MotherBoard : ASROK 945 GCM
Processor : Pantium
HDD : HDD 160 GB
RAM : DDR-2 1 GB
Cassing : NULL
ExtraConfig : CD ROM ASUS

Now we shall convert it to XML (for converting Object to XML you can check here)
Here is the xml of above object
Continue reading