SlideShare une entreprise Scribd logo
1  sur  15
See Sharp
A C# programming tutorial


Prepared By: JM Ramos
Hello World – A quick glance of this
tutorial
   •   Introduction to C#.net
   •   Introduction to SQL
   •   The OLEDB Library
   •   Setting up your connection string
   •   Creating the connection Class
   •   Create Read Update Delete
       (CRUD)
What’s with C#

   • The Language of choice in the
     .NET Framework
   • Comes with a clear syntax, derived
     from C/C++
   • Ease with learning the language
   • C# is a “Type Safe Language”
What can you do with C#

   • Windows Applications
   • Web Applications (ASP.NET)
   • Web Services (WCF)
Structured Query Language (SQL)

   • A language use for manipulating
     and retrieving records in a RDBMS
   • Based on Relational Algebra tuple
     relational calculus, its scope
     includes data insert, query, update
     and delete, schema creation and
     modification, and data access
     control.
Adding Records to your Table

   INSERT INTO
   table_name(column1,column2)
   VALUES(value1,value2);


   Specifying the columns and
   corresponding values on
   those columns.
Adding Records Cont..

   INSERT INTO table_name
   VALUES(value1,value2,..valueN);


   Use for adding records
   provided that the number of
   values match the number of
   columns
Sample INSERT INTO
Statement
  Let’s assume we have table
  phonebook with 3 columns,
  FirstName, LastName, and
  PhoneNumber

  INSERT INTO phonebook
  VALUES(‘jm’,’ramos’,’123’);
Modifyng Records

  UPDATE table_name SET
  column1 = value1, column2 =
  value2 WHERE id = my_id;

  Updates the record that has
  the id of my_id;
Sample UPDATE Statement

  UPDATE Phonebook SET
  PhoneNumber = ‘09099234556’
  WHERE FirstName = ‘jm’;

  Updates all records that
  has a firstname of ‘jm’
Deleting Records

   DELETE FROM table_name
   WHERE id = my_id;

   Deletes the record the has
   the id = my_id. If the user
   fails to put a where
   condition, all records from
   the table will be lost.
Retrieving Records

   SELECT (column1, column2)
   FROM table_name WHERE id =
   my_id;
   Returns a result set
   containing columns
   specified in the query
   satisfying the condition
   Where clause is optional
Enough with the Crap. Coding na!

   • :DDDDD
Things to Remember:

  • String data types in SQL should be
    enclosed with single quotes.
  • Values are separated by commas
  • End every statement with
    Semicolon
  • Just get what you need.
  • Use pascal casing.
References

  • Beginning Visual C# 2010 (Watson
    2010)
  • http://en.wikipedia.org/wiki/SQL

Contenu connexe

Tendances

Introduction to .net framework
Introduction to .net frameworkIntroduction to .net framework
Introduction to .net frameworkArun Prasad
 
Introduction To C#
Introduction To C#Introduction To C#
Introduction To C#rahulsahay19
 
Core java complete ppt(note)
Core java  complete  ppt(note)Core java  complete  ppt(note)
Core java complete ppt(note)arvind pandey
 
CSharp Presentation
CSharp PresentationCSharp Presentation
CSharp PresentationVishwa Mohan
 
Collections and its types in C# (with examples)
Collections and its types in C# (with examples)Collections and its types in C# (with examples)
Collections and its types in C# (with examples)Aijaz Ali Abro
 
Introduction to objective c
Introduction to objective cIntroduction to objective c
Introduction to objective cSunny Shaikh
 
.NET and C# Introduction
.NET and C# Introduction.NET and C# Introduction
.NET and C# IntroductionSiraj Memon
 
C presentation book
C presentation bookC presentation book
C presentation bookkrunal1210
 
Object Oriented Programming with C#
Object Oriented Programming with C#Object Oriented Programming with C#
Object Oriented Programming with C#foreverredpb
 
dot net technology
dot net technologydot net technology
dot net technologyImran Khan
 
Introduction To Dotnet
Introduction To DotnetIntroduction To Dotnet
Introduction To DotnetSAMIR BHOGAYTA
 
Classes, objects in JAVA
Classes, objects in JAVAClasses, objects in JAVA
Classes, objects in JAVAAbhilash Nair
 

Tendances (20)

C# Basics
C# BasicsC# Basics
C# Basics
 
Introduction to c#
Introduction to c#Introduction to c#
Introduction to c#
 
Introduction to .net framework
Introduction to .net frameworkIntroduction to .net framework
Introduction to .net framework
 
Introduction To C#
Introduction To C#Introduction To C#
Introduction To C#
 
Core java complete ppt(note)
Core java  complete  ppt(note)Core java  complete  ppt(note)
Core java complete ppt(note)
 
C# language
C# languageC# language
C# language
 
CSharp Presentation
CSharp PresentationCSharp Presentation
CSharp Presentation
 
C sharp
C sharpC sharp
C sharp
 
Collections and its types in C# (with examples)
Collections and its types in C# (with examples)Collections and its types in C# (with examples)
Collections and its types in C# (with examples)
 
Java Programming
Java ProgrammingJava Programming
Java Programming
 
C# - Part 1
C# - Part 1C# - Part 1
C# - Part 1
 
Introduction to objective c
Introduction to objective cIntroduction to objective c
Introduction to objective c
 
.NET and C# Introduction
.NET and C# Introduction.NET and C# Introduction
.NET and C# Introduction
 
C# in depth
C# in depthC# in depth
C# in depth
 
C presentation book
C presentation bookC presentation book
C presentation book
 
Object Oriented Programming with C#
Object Oriented Programming with C#Object Oriented Programming with C#
Object Oriented Programming with C#
 
dot net technology
dot net technologydot net technology
dot net technology
 
Introduction To Dotnet
Introduction To DotnetIntroduction To Dotnet
Introduction To Dotnet
 
Programming with c#
Programming with c#Programming with c#
Programming with c#
 
Classes, objects in JAVA
Classes, objects in JAVAClasses, objects in JAVA
Classes, objects in JAVA
 

Similaire à C# Tutorial (20)

C# Basic Tutorial
C# Basic TutorialC# Basic Tutorial
C# Basic Tutorial
 
dbs class 7.ppt
dbs class 7.pptdbs class 7.ppt
dbs class 7.ppt
 
MySQL Database System Hiep Dinh
MySQL Database System Hiep DinhMySQL Database System Hiep Dinh
MySQL Database System Hiep Dinh
 
mysqlHiep.ppt
mysqlHiep.pptmysqlHiep.ppt
mysqlHiep.ppt
 
Database COMPLETE
Database COMPLETEDatabase COMPLETE
Database COMPLETE
 
PT- Oracle session01
PT- Oracle session01 PT- Oracle session01
PT- Oracle session01
 
MySql slides (ppt)
MySql slides (ppt)MySql slides (ppt)
MySql slides (ppt)
 
LECTURE NOTES.pdf
LECTURE NOTES.pdfLECTURE NOTES.pdf
LECTURE NOTES.pdf
 
LECTURE NOTES.pdf
LECTURE NOTES.pdfLECTURE NOTES.pdf
LECTURE NOTES.pdf
 
Oracle notes
Oracle notesOracle notes
Oracle notes
 
Database Management Lab -SQL Queries
Database Management Lab -SQL Queries Database Management Lab -SQL Queries
Database Management Lab -SQL Queries
 
SQL Queries Information
SQL Queries InformationSQL Queries Information
SQL Queries Information
 
Dbms sql-final
Dbms  sql-finalDbms  sql-final
Dbms sql-final
 
SQL Server Select Topics
SQL Server Select TopicsSQL Server Select Topics
SQL Server Select Topics
 
Sql tutorial
Sql tutorialSql tutorial
Sql tutorial
 
Introduction to sql
Introduction to sqlIntroduction to sql
Introduction to sql
 
Module 3
Module 3Module 3
Module 3
 
Introduction to sql new
Introduction to sql newIntroduction to sql new
Introduction to sql new
 
SQL Overview
SQL OverviewSQL Overview
SQL Overview
 
Lab
LabLab
Lab
 

C# Tutorial

  • 1. See Sharp A C# programming tutorial Prepared By: JM Ramos
  • 2. Hello World – A quick glance of this tutorial • Introduction to C#.net • Introduction to SQL • The OLEDB Library • Setting up your connection string • Creating the connection Class • Create Read Update Delete (CRUD)
  • 3. What’s with C# • The Language of choice in the .NET Framework • Comes with a clear syntax, derived from C/C++ • Ease with learning the language • C# is a “Type Safe Language”
  • 4. What can you do with C# • Windows Applications • Web Applications (ASP.NET) • Web Services (WCF)
  • 5. Structured Query Language (SQL) • A language use for manipulating and retrieving records in a RDBMS • Based on Relational Algebra tuple relational calculus, its scope includes data insert, query, update and delete, schema creation and modification, and data access control.
  • 6. Adding Records to your Table INSERT INTO table_name(column1,column2) VALUES(value1,value2); Specifying the columns and corresponding values on those columns.
  • 7. Adding Records Cont.. INSERT INTO table_name VALUES(value1,value2,..valueN); Use for adding records provided that the number of values match the number of columns
  • 8. Sample INSERT INTO Statement Let’s assume we have table phonebook with 3 columns, FirstName, LastName, and PhoneNumber INSERT INTO phonebook VALUES(‘jm’,’ramos’,’123’);
  • 9. Modifyng Records UPDATE table_name SET column1 = value1, column2 = value2 WHERE id = my_id; Updates the record that has the id of my_id;
  • 10. Sample UPDATE Statement UPDATE Phonebook SET PhoneNumber = ‘09099234556’ WHERE FirstName = ‘jm’; Updates all records that has a firstname of ‘jm’
  • 11. Deleting Records DELETE FROM table_name WHERE id = my_id; Deletes the record the has the id = my_id. If the user fails to put a where condition, all records from the table will be lost.
  • 12. Retrieving Records SELECT (column1, column2) FROM table_name WHERE id = my_id; Returns a result set containing columns specified in the query satisfying the condition Where clause is optional
  • 13. Enough with the Crap. Coding na! • :DDDDD
  • 14. Things to Remember: • String data types in SQL should be enclosed with single quotes. • Values are separated by commas • End every statement with Semicolon • Just get what you need. • Use pascal casing.
  • 15. References • Beginning Visual C# 2010 (Watson 2010) • http://en.wikipedia.org/wiki/SQL