Main

C# Tutorial for Beginners | Learn C# Programming | Learn C# Step by Step | Learn C# .NET

Start with latest C# tutorial for beginners(4 hrs):- https://youtu.be/AxEGRBFwlmI For more such videos visit http://www.questpond.com For more such videos subscribe https://www.youtube.com/questpondvideos See our other Step by Step video series below :- JavaScript Interview Questions: https://youtu.be/Zb4dPi7CANU Abstract class vs Interface in C# :- https://youtu.be/0EnSPBVrbG0 C# tutorial for beginners(4 hrs):- https://youtu.be/AxEGRBFwlmI C# interview questions and answers:- https://youtu.be/BKynEBPqiIM ASP.NET MVC Core Interview Questions with answers:- https://youtu.be/pXmMdmJUC0g Angular Interview Questions and Answers :- https://youtu.be/-jeoyDJDsSM Learn Azure Step by Step:- https://youtu.be/wdUK7bCMXqs Azure AZ-900 fundamentals certification :- https://youtu.be/hC9iGgJorz8 AZ- 204 certification Azure:- https://youtu.be/qI8PRn2C080 Learn Design Pattern Step by Step https://goo.gl/eJdn0m Learn Angular tutorial step by step https://tinyurl.com/ycd9j895 Learn MVC Core step by step :- http://tinyurl.com/y9jt3wkv Learn SharePoint Step by Step in 8 hours:- https://goo.gl/XQKHeP Python Tutorial for Beginners:- https://youtu.be/KjJ7WzEL-es Learn Data Science in 1 hour :- https://tinyurl.com/y5o7qbau Learn Power BI Step by Step:- https://tinyurl.com/y6thhkxw PHP Interview Questions : https://youtu.be/1bpNSynUrl8 Learn MSBI Step by Step in 32 hours:- https://goo.gl/TTpFZN Learn Tableau step by step :- https://tinyurl.com/kh6ojyo Learn SQL Server Step by Step http://tinyurl.com/ja4zmwu Learn C# fundamentals in 100 hours :- Lab 1 :- C# fundamentals,For loop,data types,Error handling, classes / objects , Methods and functions. Lab 2 :- Synch, Asynch, Delegates, Multicast Delegates and Events. Lab 3 :- Simple File Search project. Lab 4 :- Customer Project(2 layers and validations). Lab 5 :- Inserting customer data using ADO.NET. Lab 6 :- Display, Update and Delete. Lab 7 :- Reusability and Configuration. Using SQL script files. Lab 8:- Implementing the Product master table. Lab 9 :- Implementing Stored Procedures. Lab 10 :- In-memory inserts and update. Other sections for reference. C# Fundamentals (8 Hours):- https://youtu.be/gaDn-sVLj8Q OOPs (4 Hours):- https://youtu.be/0po_wmSEW1Q SQL (8 Hours):- https://youtu.be/wp0N1tYjEWc ADO.NET (4 Hours):- https://youtu.be/nwBBd9GrcqI LINQ EF (4 Hours):- https://youtu.be/Kn_clV8mVOM WPF (4 Hours):- https://youtu.be/SD3yVqpu4e4 JavaScript (1 Hours):- https://youtu.be/ByG-RU5fCcQ Angular (8 Hours):- https://youtu.be/0kmdjqgO9IY JQuery (4 Hours):- https://youtu.be/VDlGgPNsaiM MVC (16 Hours):- https://youtu.be/Lp7nSImO5vk ----------------------------------------------------------------------------------------------- For more details :- 🌐 Website : www.questpond.com 📱 Mob. No. : +91-9967590707 / +91 7700975156 / +91-22-49786776 📧Email : questpond@questpond.com / questpond@gmail.com / questpond@yahoo.com Share, Support, Subscribe and Connect us on!!! YouTube: https://www.youtube.com/questpondvideos Twitter: https://twitter.com/questpond Instagram : https://www.instagram.com/questpond/ Facebook : https://www.facebook.com/Questpond/ #LearnC#StepbyStep #CSharpTutorial #C#TutorialforBeginners #C#Developers #C#Trainingvideos #C#Programming #VisualStudio #VisualStudioC#Tutorial #C#Project

Questpond

7 years ago

Hello everyone Welcome to the series of Learn C# programming in 100 hours This is a complete beginners tutorial, in this beginners tutorial will try to see how we can become a C sharp professional or a C# developer Before we start with learn C sharp tutorial and its fundamentals First will try to understand what does it take to make a C# developer? Here is a flow of what things we need to learn to become a C# developer Start with C sharp Fundamentals like CLR, CTS, Code access security, delegate
s, events Data types, Value types, Reference types It's a most important part The next is OOP Concept like Interfaces, Polymorphism, Abstract classes etc followed by SQL followed by data access layer technologies like ADO.NET and Entity framework The first five sections are the building blocks which can help to create projects Without knowing this five things it's difficult to create a project In the Web client the first thing is we need to know HTML and JavaScript We have two ways of doing Web
programming one is the old web forms and the new one MVC In case we are doing windows track, we have Windows we have two flavors in Windows WPF and WinForms One track which is missing out in the diagram is the Mobile For Mobile we have Xamarin This is the roadmap to start with We will start with the first step i.e. C# fundamentals To learn C# programming install Visual Studio Go to www.visualstudio.com and install Visual Studio Community edition Once we download community edition in the program
file we should see Visual Studio 2015 This indicates Visual Studio has been installed successfully Start Visual Studio and create a small C sharp program Once we start Visual Studio will find a very complex application Even a senior professional guy who is working on C# programming and Visual Studio they hardly use this 10 to 15 menus If we say we want to create a C# program that means we want to create a project A Windows project, a web project, a console application, a mobile project There is
a New Project menu or we can start from File -> New -> Project Once we do a new project we will find lots of things Visual C#, Visual Basic, Visual F# etc Select Visual C# in that create a windows application. Select Windows -> Select Console Application Give a name as Lab1 These things what we see over here are termed as Templates There are various types of application like Windows, Web, Mobile What is a Console Application? A console application is an application which runs through command pr
ompt A console application does not have any kind of UI It runs on the black dos window Select Console application -> Press OK Once we press OK we would see a very complex code At the left hand side what we see is they are line numbers saying that which code is on which line Before we go in depth into this code First under stand three concepts Language, Framework and IDE IDE stands for Integrated Development Environment Will understand the difference between all of these three Language is a prog
ramming language like C# programming where we can write if condition, For loops, invoke things and consume things etc Language have syntaxes for example this whole source code is written in C# Language When we go to professional applications we need lot of things like send an email or make a data base connection These are some of the very common things we would be doing again and again If there where some kind of a readymade library which we can use in C# programming or invoke in C# language tha
t would improve the productivity and we have something called as the .NET framework When we install Visual studio 2015 in the C Windows -> -> Microsoft .NET There are lots of DLLs with lot of versions of framework .NET was introduced in 2003 formally from that point onwards we have 1.1, 2.0, 3.0, 3.5, 4.0 and the latest one 4.5 There are some readymade components For database we have System.Data.dll This component has code which will help to connect to RDBMS One is we have a C# Language The seco
nd one is we need some readymade components/reusable components that is what we have in the framework The .NET framework is a reusable library which has lot of things while creating the application The .NET framework is also compiles the code When we write something in C# programming, to execute inside the machine compile the program Even the .NET framework has a JIT compiler which compiles source code into machine language If we try to do this manually it is very difficult That's where we have
the IDE IDE is a tool which will help us to write the syntaxes, compile the program, run the application, publish With that the development life becomes very easy What we see out here is a C# language Internally the C# language uses the .NET framework components .NET framework is a core thing C# uses these components IDE ties both of them together so we can complete the development faster When we talk about a complex project It will not have only one file of source code it can have multiple file
s of source code it can have configuration and lot of things A project will have many files with configurations, resources, text files, data files etc When we create a project they create two things one is they create a solution Inside the solution they create a project We have Lab1 Lab1 belongs to Solution Inside the project we can have lot of files This code is in a program.cs there is also a configuration file call ed as App config which is a XML file which can help to provide configuration t
o the application There is also a references section In the references section it is saying that the project is referring what components from the .NET framework Go to the properties of system.data This project is referencing System.data A c# project is nothing but it has many files which can have code files means program.cs, configuration files It also shows which libraries of .NET framework we have referred This is termed as a project A solution is a combination of projects We can have Lab1, L
ab2, Lab3 etc We can have four or five projects in a solution Every project will have multiple files Whenever we'll write C# code it will always have this kind of structure At the top we will have a Namespace This visual studio IDE has given a nice provision which will help to expand and collabs the code When we write any C# code it has it is always written inside a method Inside the Namespace we have Class Inside the class we have Method Always write the code inside a method A method will alway
s belong to a class and a class will belong to the Namespace One namespace can have multiple classes One class can have multiple methods We have a namespace, inside which we have a class program inside that we have a method called as Main Start putting comments So we can understand the source code well A comments is a line of text which we put inside the code but it will not be checked for syntaxes, it is only for documentation purpose To write a comment put a double slash Point 1:- We have a hi
erarchy of namespace inside the namespace -> class--> Method Ponit 2:- This name is the first entry point of the program Main means this is the first thing that will execute For now we can neglect the word static The void main is a method a method where we can have group of C# statements In this we can write two to three statements of C# Method helps to group a C# statement At the top we have using will delete that When the method is executed we can also pass parameters to the program string[ ]
args is a parameter i.e. Point 3 In args we have parameters We will write a simple Hello inside the void main If we very closely look at the .NET framework components Everything has a system at the top after the system there is Activities or Collections The complete .NET framework is organised like System.Collections.Concurrent To print a "Hello World" on the console System. Console .Writeline The namespace is having a black color The class has a light aqua color The method has a black color Sys
tem is a namespace The console is a class Write is a method WriteLine (""Hello my first program") If we put in a simple words it means that even the core .NET framework follows the hierarchy of namespace, class and method If we write big lines of code like System.Console.WriteLine etc it would be very difficult after a certain time to read the code Some of those namespaces are quiet long We can type at the top using System If we do this we don't have to write the System, we can start from Conso
le Point no. 4 :- Import the namespace system When we write any program either in C#, Java, C++. At the end of the day it has to be compiled to a machine language or we won't be able to run the program That process is termed as Build To build click on Build -> Click on Build Solution There is a output window In the output window it says the build has started what did it build, where is the exe created and build has succeeded The output window is a small window where it say what is happening with
the program To see the output window Click on View -> Output It has created the Lab1.exe in the bin folder in debug View -> Solution explorer This code is going to be saved in the certain fiile To know where it is Right click on the project -> Open folder in file explorer When a program gets compiled in visual studio, it throws the compile code in the bin directly In the bin directory there is a debug folder In that there is Lab1 exe Double click on this It starts and closes we are not able to
see the output Why is it happening? It first comes inside the static void main execute the console.writeline and after this we have not given anything to stop the program It runs and goes off After this will say Console.Read means read some input and wait for sometime Our first program of C# with the Hello world To pass arguments to this program we can always pass arguments from the command prompt and we can pass the multiple arguments The square bracket indicates an array so we can have multipl
e inputs If we have the first input add to it means concatenate with the first args i.e. passed then concatenate a space and concatenate the second argument Which we have in the program is a constant strings after that please concatenat whatever is the first argument i.e. coming from the input and then concatenate a space and then concatenate the second argument The first argument is 0. Here we did not say 1 we said 0 The first argument which we pass over here we have referring a program by usin
g 0 first This is termed as 0 indexing means even though there is a first argument inside the program we have to refer 0 The second argument is 1 then 2, 3 etc To pass arguments run the program via the command prompt Windows key+R and type cmd in the run Go to the folder where the exe is Browse to the folder say cd and paste the folder path If we do a directory, we can see Lab1 In this we will pass the first argument then pass the second argument test The first argument is XYZ and the second arg
ument is Test Press Enter It has taken Hello my first program then concatenate the first argument The first argument is XYZ then concatenated the second argument i.e. Test with a space in between When we create a real time application people will not pass data via arguments They would run the program and enter data via keyboard We should allow the user to take data via the application Whatever data comes from the keyboard, store it in a variable and do some operations using the data A Variable i
s a small memory allocation where we can store data Store a persons name, for that we will create a variable which is of type string Type string means it can have numerics Take the name of a person and age of a person In order to take the input use Console. ReadLine ReadLine reads the data from the keyboard and WriteLine writes the data from the console In this Name do a Console. ReadLine Get data into the name for the name For the Age get data using Console.ReaLline Point no. 5 ReadLine takes d
ata from keyboard and WriteLine writes data Hello concatenate the name and concatenate the age Till we were building the project. Going to bin directory. We can run the application right from visual studio itself by doing Control+F5 We are not getting an idea is this to enter the name or is this to enter the age Console.WriteLine "Enter Name" Console.WriteLine "Enter Age" Do a Control+F5 We have created a very small application where a person can put his name and age and display the details on
the screen There is a bug in this program The bug is that When he says "Enter Age" we can put any kind of character which is not acceptable but the application accepts that and display it In age we cannot put non-numeric characters We need to define the variables data type as String means we can have non-numeric values and int will only have numeric values It is showing a red sign saying we cannot take this kind of data which is nothing Whenever we have errors in the program visual studio shows
the errors in the red zigzag sign We cannot convert this string to an int When we put data from the keyboard we can put a text The Console.ReadLine is returning a string But a string cannot go into the age because age is an int Console.ReadLine whenever reads data from the keyboard converts into a string data type This string datatype we cannot move it to a integer data type of Age For that we will say Convert.ToInt The Convert is a class ToInt is a method which will convert the string into age
In case the conversion fails then the application will crash If we try to put something else If we try to put a non-numeric data The application has crashed it says we cannot convert the string into the integer The application is not taking data which is not proper We will have a separate C# tutorial on Error handling To handle the error we can use the try catch Inside this try the start and the end of the try block if there is any exception which occurs just throw it to the catch If there is a
ny exception which happens in the try block the control will come in the catch Console.WriteLine "Please try invalid data We have written in the try statement the complete code where we expect the error can occur and in the catch statement we have written how to handle it Drastic error message which was coming previously it is not coming now The program is using string, integer and there are other data types like boolean, double, decimal etc Go to the fundamental section In that we have a 40 mi
nutes video which is only on data types We are doing coding, C# programming we have to also understand the internals of .NET We have just used here int int also has other variation like int32, int16, double, single, decimal, float, string etc If the name is not proper then do not continue with the program After that we do not want to continue with the program Console.Read and return Why we are doing a Console.Read? The end user can see the error message and after that if we say return from here
that means the remaining part of the code will not execute In the same way we will put some validation for the Age If the Age is entered above 100 then we will say Age is not proper The if condition which we are using for checking the validations, the way it is written if starts with a round bracket then the condition and then what we want to write If we do not put a name it says name is required If we put age 900 it says age is not proper To write a if condition if then the condition and then
what we want to execute if the condition is true If we want to add in one go two or three records rather than running the exe again and again If we can get some option like Enter how many records we want to enter and if there is a loop which can keep looping until we enter all the records Write a For loop Console.WriteLine "Enter how many records we want to enter int numrecords = Console.ReadLine This is a numeric we need to do a convert Convert this to a ToInt16 ToInt16, Integer, Int32 has been
explained in the data type video Run this whole try loop From here till the catch run the complete for loop After that do a Console.Read We will create a temporary variable For takes three parameter or three things in actually One it takes from where we want to start the counting Will start the counting from 0 till what we want to go will go till the numrecord And increment one by one i++ Run this First he will ask "Enter how many records" First record is Shiv the Age The second record is Raju
and the age 10 Try with three records The for loop is running it is allowing to add multiple records in one go This i++ goes and increments the value of i also we can write the syntax as ++i Watch the small video What is the difference between i++ and ++i? If we watch the video, we can understand the difference between Post-increment and Pre-inrcement This code is extremely complex and extremely muddled up If we have 5 to 10 properties we would end up into so many variables like Name, Age,Addres
s etc Rather than thinking in terms of Name, Age and variables how about saying there is a person There is a person in the real world and this person has a name age address We have Object Oriented Programming Rather than thinking in terms of individual variables think in terms of classes In the code we have class called as person This person has a Name This person has an Age an Address and Salary For salary use decimal Decimal has a high precision We have put up a class person Inside this class
we will add a method This method will tell this person is valid or not All these if conditions which are going to scattered the validations Put them into one class if (Name.Length is not proper then this not valid If the Age is greater than 100 it is not valid If the age is greater than 100 then return false; If everything is okay then the return is true The place where we have the return statement from here the below code do not executes Rather than having hanging variables, we have created a c
lass We can think about a class as a template A template which represents a real world identity like person, car, accounts, journal manager To use in a program create an object Delete all this and replace it with the object Create a separate copy of this file to refer the source code later on The old source code is still there in the ProgramCopy.cs Comment all these code because it is giving duplicate class name errors Create the object of person Person is a class, a template To use it in the pr
ogram anywhere create an object To create an object use the "new" keyword This code is much better as compared to the previous code We are able to associate with the real life objects and will display here Console.WriteLine Name of the person obj. Name and age obj.Age Once we start putting things into classes and objects it becomes very simple, neat and clean To understand these classes and objects we need to understand the object oriented programming concepts in detail Go though OOP Q & A video
series where we have explained what are classes? What are objects? What is inheritance, polymorphism and encapsulation? Interfaces, Abstract classes, Shadowing Object oriented programming is one of the big concept by itself This for loop will run and the person object will be created After that enter the name, enter the age and the person object data will be displayed Do a Control+F5 We had created the the valid function We can also use the valid function if the obj is valid then only do a Cons
oleWriteline of the Age or else just say it is invalid data The valid function returns true and false it returns false if we don't enter the proper name or an age It returns true if everything is proper One is a method and the other one is a function A method has a group of C# code The static void main is a method and it has a code inside it A method does not return anything The main method is returning void, void means We had create a method inside the person class which was returning true and
false The valid is not a method, it is a function When a method returns something term it as a function When the method does not return anything then term it as a method That brings us to the first 1 hour of training of C# for beginners We have completed the first one hour from C# fundamentals In this one hour we have covered lot of topics We saw where to get visual studio from. We saw what is Visual Studio.Visual Studio What is a Language, what is a framework Created a small console application
where we did validations where we did a for loop, if condition etc The next tutorial is on Delegates, Events and Threads Please watch the video on IIL Code, CLR CTS and Code access security When we compile the program Lab1.exe which gets created in the debug folder Lot of people think this exe is fully compiled machine language but it is not It is a partially compiled code or a half compile code This video is divided into 2 parts, one is of 9 minutes and the other one is of 10 minutes Will do
practicals and at the same time parallely will see individual fundamentals as well To become a C# developer it is not about just writing if conditions, for loops and declaring variables but also know internally how C# programming works We will continue with this project of person details We will be doing Learn C# tutorial and side by side we will have small Q & A video which will help to understand the fundamentals in more debth Will upload the source code in the questpondvd account as well we
have more 7 hours pending in Learn C# fundamentals Here is a small C# quick notes document This is a 100 page document In this we have explained the concepts in a question answer format It's a Q & A book Share this video on facebook account, twitter account and mail us the shared link to questpond@questpond.com We will email this book Which will help to quickly revise thing before interview of a fundamentals The next lab is on delegates and events Thank you very much....

Comments

@questpondvideos

ASP.NET, C# Job Market : https://youtu.be/H3JEWAp32-s 30 Important C# Interview Questions : https://youtu.be/BKynEBPqiIM 25+ OOPS Interview Questions : https://youtu.be/u99wAoBjDvQ 20+ SQL Server Interview Questions : https://youtu.be/SEdAF8mSKS4 10+ Power BI Interview Questions : https://youtu.be/Cozc9WNBRt4 20 MSBI Interview Questions : https://youtu.be/Nw_sHEKnOUE SQL Server Joins : https://youtu.be/KTvYHEntvn8 SQL Step by Step - https://youtu.be/uGlfP9o7kmY Angular Step by Step Tutorial for Beginners : https://youtu.be/-9VcW7MBDs8 25 Angular Interview Questions : https://youtu.be/-jeoyDJDsSM 25 Important ASP.NET Interview Questions : https://youtu.be/pXmMdmJUC0g 35 Important JavaScript Interview Questions : https://youtu.be/Zb4dPi7CANU 20 MySQL Interview Questions : https://youtu.be/9hfjC-BpY20 5 MSBI Interview Questions : https://youtu.be/5E815aXAwYQ 20 PHP Interview Questions : https://youtu.be/1bpNSynUrl8

@TravelChannelOne

The best tutorial ever!!!!

@balevijay

Good Tutorial. So I shared. Thank you for this good tutorial.

@bobbygD

The best C# Tutorial I have ever come across. Thank you very much.

@sameraabu

thanks for this tutorial. waiting next vedio

@shovikanand3214

One of Best c# teacher u r.....thanks a ton sir

@francoispiano_public3896

Very good C# presentation by François T.

@Pareshbpatel

Thanks for a very good video tutorial introducing CSharp. Many Thanks.

@aravindannarayanan2831

Excellent opening presentation.seen many videos...you have attracted by road map diagram

@shivakumar-ug5gs

Clear and Succinct tutorial. Thanks.

@elitesystemservicesislamab4732

Awsome lecture sir, Thenks and manay many respects for you. learned a lot from this video

@bakhchacsharp2252

One of Best c# teacher

@williamcox1176

Very good, An understandable start to C sharp.

@greztangayan8795

hi... i like the way u teach....#perfect ,,,,easy to understand....just PERFECT

@adamkuskoslav8214

Great tutorial for beginners

@pusongaming9860

Best course for c#. TnQ bro

@anthonywilliams4825

Very good tutorial, I will be in touch.

@dacracking5768

Dude your amazing! Thank you for your tutorials

@meedowload795

Nice tutorial. Just a little warning: Convert.ToInt16 convert to a Short, so the variable Age should be a Short or you should use Convert.ToInt32 instead to convert to an Int (Convert.ToInt64 converts to a Long)

@mohammedrazvi3681

mast video hai sir ji app step by step bana dijiye ga sarray 100 hours videos