Posts

Showing posts with the label .NET

TypeScript: JavaScript like Programming Language by Microsoft

Image
Okay, here is a great news, Microsoft has released a developer preview of TypeScript, a new programming language like JavaScript that is translated into JavaScript so that its apps can be run in any browser. In other words, TypeScript is a superset of JavaScript and you write it like you write JavaScript. And today, I explored it and I am sharing it with you.

Playing with Entity Framework's Code First Database Migration

Image
In this video you will learn how to use Entity Framework's Code First Database Migration. I'll create simple console application and will add 'Student' model and then a DbContext in the project.

Enum Support (EF Designer) in Entity Framework 5

Image
Entity Framework 5 brings number of improvements and Enum Support in EF Designer or Code First is one of them. In this post you will learn it by creating a simple console application then will add EF Designer and will sketch the Model on designer surface. Please note, EF Designer can also be used with the Database First workflow to map to an existing database.

Enum Support (Code First) in Entity Framework 5

Image
Entity Framework 5 brings number of improvements and Enum Support in Code First is one of them.

Normal LINQ Query to Compiled LINQ Query to Auto-Compiled LINQ Queries in Entity Framework 5

Entity Framework 5 brings number of improvements and query performance improvement is one of them. In this article I’ll be talking all on query performances (EF1 to EF5) so that you can understand the improvements better.

HTTP Error 404.0 - Not Found in MVC

Image
The Resource you are looking for has been removed, had its name changed, or is temporarily unavailable. I saw this error today while working on a MVC Web Project, this is a common error we get while running website and performing any CRUD (Create, Read, Update, Delete) operation. Stackoverflow is full of such queries so I decided to post the fix here. You might not find it useful for your case but I think majority of requests can be satisfied.

Browse With Option (Set Multiple Defaults) in Visual Studio 2012

Image
In Visual Studio 2012 we got some really exciting new features. And setting multiple defaults to browse with option is one of them. So, watch the video and see how it really works.

How to format the arrangement of codes in Visual Studio IDE

Image
I know it is very easy for all, think of me as blogging addicted guy. Ehehe. Shortcut Keys:- Format Entire Document : Ctrl + K, Ctrl + D Format Selection : Ctrl + K, Ctrl + F

Razor View Engine in MVC 3

Image
In this e-book you will learn all about Razor View Engine introduced with the release of MVC 3. I will walk through the simple steps and even I will keep my ideas simple so that you can understand the Razor View Engine quickly. My aim through this e-book is to teach Razor so I am going to play a little loose with rest all. Get it Now (PDF Format e-book and Sample Codes) Published on debugmode.net by Dhananjay Kumar: debugmode.net Published on cshandler.com by Amit Choudhary: cshandler.com Published on FB by Kunal Chowdhury: facebook.com Published on kunal-chowdhury.com by Kunal Chowdhury: kunal-chowdhury.com Published on justlikeamagic.com by Mohammad Elsheimy: justlikeamagic.com Published on coolthingoftheday.blogspot.com: coolthingoftheday.blogspot.com Published on

Managed and Unmanaged Code

Managed and Unmanaged Code Managed Languages made of assemblies (EXE and DLLs) containing code written in intermediate language (IL). This code is not machine code. When the application runs, the code is executed by the .NET runtime, which in turn executes the corresponding machine code. The code is managed by the .NET runtime. Managed code is typically slower than machine code, because of the additional layer between the code and the machine. However, the .NET framework offers many advantages over unmanaged code: ·    A huge number of built-in high level libraries. ·    Stable code has fewer errors ·    Errors will be found when you compile the application, instead of appearing at runtime.   Traditional Windows Applications were (and still they are used somewhere) often programmed using a framework known as MCF (Microsoft Foundation Classes). In this framework code compiles directly to machine code, which is referred as low-level, and very near to machine code.

Testing Website using SSL on Localhost (IIS)

Image
Introduction SSL (Secure Socket Layer) is a cryptographic protocol developed by Netscape to provide communications security on internet. Cryptographic technology uses two keys to encrypt data, one for public (public key) and another for recipient (secret key). SSL enabled website communicates with web server by using security channel (secret key) that prevents tempering, eavesdropping (or simply say hacking). Mostly probably SSL is used on login section, payment system, online banking system etc that is very sensitive information for organization. When we enable the SSL for website URL will start with https:// instead of http://. Requirements To test this, you should have IIS installed. No need of extra software like Visual Studio or any other website development kit because only a single HTML file can be tested. Follow the steps to enable SSL on Windows Server 2008 R2 Operating System; another Operating System may have little difference. Step 1 Open IIS Manger and

Quickest Way to add Namespaces in Applicationspace in your Application

Image

Web Services

Image
Introduction   Download As name "Web Services" suggests, it is a method of communication between two electronic devices over the web (internet). A web service is not a website that a human reads. It is not anything with which an end user would directly interact. A web service is a standard platform for building interoperable distributed applications. It allows you as a developer, to interact with other information providers without worrying about what they are running either at the backend or even their front-end. Points to remember * WS are small units of code. * WS are small unit of codes that is designed to handle limited set of tasks. For example, online payment system communicates using Web Services. * WS are independent of OS and Programming Languages. * WS are not limited to OS type or Programming Languages as it communicates using open protocol systems. * WS are designed to handle

Reading Data From Database and Display in Label or other control

Reading Data From Database and Display in Label or other control DataSet dtst = new DataSet();         SqlConnection sqlCon = new SqlConnection(ConfigurationManager.AppSettings["ConnectionString"]);         string strSql = "SELECT FieldName FROM TableName WHERE FieldName LIKE '" + prefixText + "%' ";         SqlCommand sqlComd = new SqlCommand(strSql, sqlCon);         sqlCon.Open();         SqlDataAdapter sqlAdpt = new SqlDataAdapter();         sqlAdpt.SelectCommand = sqlComd;         sqlAdpt.Fill(dtst);         string[] cntName = new string[dtst.Tables[0].Rows.Count];         int i = 0;         try         {             foreach (DataRow rdr in dtst.Tables[0].Rows)             {                 cntName.SetValue(rdr["CountryName"].ToString(), i);                 i++;             }         }         catch { }         finally         {             sqlCon.Close();         }         return

Switch Case Fall-Through Rules in .NET

Because you cannot accidentally fall through from one case label to the next if there is any intervening code, you can freely rearrange the sections of a switch statement without affecting its meaning (including the default label, which by convention is usually placed as the last label but does not have to be). C and C++ programmers should note that the break statement is mandatory for every case in a switch statement (even the default case)  This requirement is a good thing; it is common in C or C++ programs to forget the break statement, allowing execution to fall through to the next label and leading to bugs that are difficult to spot. If you really want to, you can mimic C/C++ fall-through in C# by using a goto statement to go to the following case or default label. Using goto in general is not recommended, though, and this book does not show you how to do it.

Generating Method Stub in Visual Studio

Image
Introduction This post is for those who still don't know Method Stub or using a boring style method writing technique. Visual Studio IDE has a great feature named Generate Method Stub which let generate Method Stub automatically. What is Method Stub? Method Stub is a feature that helps developer to generate the method codes by just clicking a button. Let's look what MSDN says :- Generate Method Stub is an IntelliSense Automatic Code Generation feature that provides an easy way to have Visual Studio create a new method declaration at the time you are writing a method call. Visual Studio infers the declaration from the call. Some programming styles, such as test-driven development, suggest that you should consume before you define. That way, it is easier to figure out the form of the API that you are developing. You can use IntelliSense to program in that style. Using the Generate Method Stub operation, you avoid defining everything before you consume i

Popular posts from this blog

Migrating database from ASP.NET Identity to ASP.NET Core Identity

Customize User's Profile in ASP.NET Identity System

Lambda two tables and three tables inner join code samples