Posts

How to use AngularJs with MVC C#

Image
So this tutorial is related to JSON data Download the project file form here What we will do in this tutorial? 1. Will know what is JSON data? 2. How to get JSON data returned from a method in C#? 3. How to use them in AngularJs or in Javascript? First start with  what is JSON data? As per Json.org it is Javascript Object Notation which is very lightweight and easy to use for machine and us also. For more details visit : http://json.org/ How to get JSON data returned from a method in C#? So yo can see video here and get to know how it actually works. Steps are as:  Take a empty MVC project and name it what ever you want.  Create a new model StudentDetails (or what ever you want you are free to do so)  Take a controller and it will be good to take Default for learning purpose  Create A JsonResult (Represents a class that is used to send JSON-formatted content to the response.) Type method as mentioned in Video  Create instance o...

Insert Unique Value in MS SQL Database By Using SQL Stored Procedure

Image
When we enter some data in database then its repetition is major problem for at all. Here I am using a table with Mobile No. as primary key and trying to insert unique value to it. You can see database in this image.   Stored procedure wants phone no as a parameter which can be passed easily create procedure insert_unique ( @phone numeric(10,0) ) as begin INSERT INTO PhoneData(Phoneno)     SELECT @phone WHERE NOT EXISTS ( SELECT phoneno FROM PhoneData WHERE Phoneno = @phone) end Pass your phone no in this procedure and it will insert only unique record.

Interview Questions on .Net Part: 1

Image
Abstraction Abstraction means displaying or allows access to that part of program or class which is important. Take an example. How to achieve that? Take the below example in which I am declaring four string and out of them only one is public and rest are private or protected. When we create object of this class and try to access all these variables then we get permission to access only public variable. class AbstractionWaliClass     {         private string my_id;         private string my_name;         public string my_contact_no;         protected string protected_id;     }     Abstract Class: If you want to create a class that is only base class. No one can make instance of it. Then you should use Abstract class with the help of k...