Monday, 20 April 2015

WebMatrix.WebData.dll into project

Including the WebMatrix.WebData.dll into the project.
I was trying it to Nuget Package to get the WebMatrix.WebData.dll but it is not getting. To get that WebMatrix.WebData.Dll into your solution you need to install it from package manager.
Open the package manager by;


Tuesday, 14 April 2015

dbcontext in mvc in not defined (mvc)

I was also facing the same problem DBContext is not Getting for MVC Model and trying in the different approach.

Added the System.Data.Entity.dll from reference but it is not working and getting as;



Tuesday, 7 April 2015

Encryption and decryption password in asp.net c#


Encrypting the password before string to the database, it’s more often that if there is plain string there is chances of hack your system by Hackers.  It will be tough for them to crack it if the password is looking like weird charter symbols.
e.g. If you store the password “test1234” to database and it will store  like; g+yC22ZOR8iB5gdYvhkZcQ==

Sharing you the simple method which is using the MD5 algorithm to encrypt the password and any provided string. MD5CryptoServiceProvider class return the hash as an array of 16 bytes.

Chart control in asp.net

Introducing the Graph/chart control of Microsoft in ASP.Net. Which will help to make your reporting beautiful for Web application Asp.net application.


Monday, 23 March 2015

MVC routing

MVC routing

MVC routing is the URL is mapped to controller and controller is mapped to any action type.
Suppose there is the control name customer where the action is  DisplayCustomer and you are checking in the local host than the URL will form as  http://localhost/ customer/ DisplayCustomer
Now lets see where the Routing configuration defined for MVC project.
You can see the below folder structure for Your MVC project and on it there is a file RouteConfig.cs



Friday, 20 March 2015

c# hashtable vs dictionary

Hashtable and Dictionary both of them are used to maintain the key, value pair only there is some basic difference that makes us to opt, any of this 2 based on the situations.

Differences  between Hashtable and Dictionary.

1.       Declaration of Hashtable and dictionary;
Dictionary:
Dictionary<int, string> dict = new Dictionary<int, string>();

Hashtable :
Hashtable hst = new Hashtable();

convert list to string c#

There are many ways you will do convert list to string c# from google. But what you will adopt, which is good in terms of line and in terms of complexity.

 I will demonstrate three ways to convert list to string c# with “,” seperated  and you will see that which one is taking less time in execution.
Suppose you have list of sting, that you can form like below code; Having 1Lakhs of string records


Thursday, 5 March 2015

mvc pass model into view

Just create the simple MVC Application and you have structure Like Below screen;


Now you can see that we don’t have Models file in the structure. Now Create a Department class and the model which will have 3 Entity :

showing viewdata in MVC 5 on razor view

In MVC Viewdata is the way to maintain the data for passing it  from Controller to View.

Just giving the below example to pass the ViewData in MVC5 on Razor View;

You have defined or pass the Viewdata from controller like below;

public class HomeController : Controller
    {
        //
        // GET: /Home/
        public ActionResult Index()
        {
            return View();
        }

        public ActionResult MyHomeview()
        {
            ViewData["Datetime"] = DateTime.Now.ToString();
            return View();
        }
       }