0% found this document useful (0 votes)
28 views

Notes

Uploaded by

bc210423749ame
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
28 views

Notes

Uploaded by

bc210423749ame
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 12

Tech Inn Solutions

WEB DEVELOPMENT

ASP.NET

ROOBA AHMAD

Started Date Total Lectures

15-Dec-18
1899 -19
SOFTWARES: + Lecture 1
☺ Microsoft visual studio 2018
☺ SQL Management studio x_64.exe
☺ SQL EXPR_X64.EXE
☺ WINRAR.EXE
☺ Power ISO 5.6+ keygan+serial.exe

Gujranwala
Page 1

2. Introduction to c#
C# was developed before 8 to 10 years ago by Microsoft.

They use as to compare with Visual basic. VB was used before 25 to 30 years
ago to build software. Examples are: Window 98, me, 2000.

Java ko dekhty huy bnai gi c#. Examples are Window-> xp, 7, 8, 10, vista

Java is a Japanese language.

Java is better due to its security and Better framework.

What is visual studio?


It is an IDE stand for integrated development environment

Link Without IDE: file-> c#-> binary language-> assembly-> processor

Link With IDE: file->processor.

Visual studio use at every time as an administrator

Console: Use for textual i\o task.no graphical functions.


How to open a project?
Visual c#->windows-> console application

Difference b/w name and solution name?


Name: Applications consist of code joint together to create a program.

Solution name: combination of multiple applications. Or multiple SW

You may change the both name. But better to use same name.

Log In, sign up are examples of solution application. Press ctrl+f5 to print
Page 2

How to print?
Console.WriteLine (“hello”); or Console.Write (“hello”); ->\n

3. Data types
Data type Use
String Anything numbers, special symbol, characters etc.
Int 1, 2, 3…
Float 0,+-1,+-2……+-9.9
Double 0, 1, 2, 3, 4…….
Bool True, False
DateTime For date time
Char To store characters
Int? Null integer-> use to store null & strings int numbers
Float? Null float-> use to store null & strings float numbers
Double? Null double-> use to store null & strings double numbers
Char? Null char-> use to store null & strings char numbers
DateTime? Null DateTime-> will store null & strings DateTime numbers
StringBuilde To add new data
r
Var Use for any type of data
Object Same as Var but a slight difference.
Restrictions of Var data type: You are not allowed to make array, list.
Object: data type change ni krta variable mn aik hisy mn variable store krta
hai. By typecasting (string) we can change data type.

Why we use (int?) this type of null?


This null is used to store null and integers but in some places we have to use
Int? with question mark sign. Like in database We cannot store null in int.
Page 3

but can store in string. Simple int is used in different applications. But to
extract data from database we have to use int? .

How to convert a data type to another?


Double x=2.7;
Method 1: Int y= (int) x;

Method2: Int y=Convert. To Int32(x);

Int32 data of 32 bit also have int16, int64.

Ternary operator:
Console.Write (age>=18?”you are adult”: “you are
younger”);

How to input in c#?


Console.WriteLine (“Enter your name :”);

String name=Console.ReadLine ();

Another format to print:

Console.WriteLine (“my name is {0} and my age is


{1}”,”Rooba Ahmad”, 18);

Will prints: my name


is Rooba Ahmad my
age is 18

List and foreach:


Page 4

Find method and FindAll method:

Find method is use to print 91 only one time. You can use findAll method
for 55 if x==55 to print 55 3 times. Here x is lamda (that is use to assume
something) for user but for compiler it is a variable.

Ctrl+a+k+d make it good to see for a user.

C#:
Sharp (#) is basically a music language that means to style.
Page 5

4. File reading and writing

StreamReader is use to read file. Press Alt+enter to load file.

Reading:

Writing:

This program will remove previously data from the file. So better method is
Page 6

You can also use write a file using while loop but it will be a huge code.

5. Object oriented programming in c#


StringBuilder is a data type use to add data. Example

Classes
Page 7

You can also create classes with the method learned in other languages.

Functions
1st method 2nd method

6. Params

Use to print array a type of like this.


Page 8

Another method of Initialization

7. Connecting sql with c#


Create query:

Create table:
Page 9

Use single quotes for inserting data in table.

Where clause:
Page 10

8. Stored procedure
What is stored procedure?

Stored procedures help reduce the traffic between application and


database server because instead of sending multiple lengthy MySQL
statements, the application has to send only the name and parameters
of the stored procedure. Stored procedures are reusable and
transparent to any applications.
For example:
Page 11

You might also like