SlideShare ist ein Scribd-Unternehmen logo
1 von 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

Weitere ähnliche Inhalte

Was ist angesagt?

Windows form application - C# Training
Windows form application - C# Training Windows form application - C# Training
Windows form application - C# Training Moutasm Tamimi
 
c#.Net Windows application
c#.Net Windows application c#.Net Windows application
c#.Net Windows application veera
 
Object-oriented Programming-with C#
Object-oriented Programming-with C#Object-oriented Programming-with C#
Object-oriented Programming-with C#Doncho Minkov
 
.NET and C# Introduction
.NET and C# Introduction.NET and C# Introduction
.NET and C# IntroductionSiraj Memon
 
Developing an ASP.NET Web Application
Developing an ASP.NET Web ApplicationDeveloping an ASP.NET Web Application
Developing an ASP.NET Web ApplicationRishi Kothari
 
Introduction to c programming
Introduction to c programmingIntroduction to c programming
Introduction to c programmingManoj Tyagi
 
C# Exceptions Handling
C# Exceptions Handling C# Exceptions Handling
C# Exceptions Handling sharqiyem
 
Regular expression in javascript
Regular expression in javascriptRegular expression in javascript
Regular expression in javascriptToan Nguyen
 
Visula C# Programming Lecture 1
Visula C# Programming Lecture 1Visula C# Programming Lecture 1
Visula C# Programming Lecture 1Abou Bakr Ashraf
 
Presentation on C++ Programming Language
Presentation on C++ Programming LanguagePresentation on C++ Programming Language
Presentation on C++ Programming Languagesatvirsandhu9
 
c# usage,applications and advantages
c# usage,applications and advantages c# usage,applications and advantages
c# usage,applications and advantages mohamed drahem
 
Static typing vs dynamic typing languages
Static typing vs dynamic typing languagesStatic typing vs dynamic typing languages
Static typing vs dynamic typing languagesJawad Khan
 
Lecture 1 introduction to vb.net
Lecture 1   introduction to vb.netLecture 1   introduction to vb.net
Lecture 1 introduction to vb.netMUKALU STEVEN
 

Was ist angesagt? (20)

C# in depth
C# in depthC# in depth
C# in depth
 
Introduction to c#
Introduction to c#Introduction to c#
Introduction to c#
 
C# classes objects
C#  classes objectsC#  classes objects
C# classes objects
 
C sharp
C sharpC sharp
C sharp
 
Programming in c#
Programming in c#Programming in c#
Programming in c#
 
Windows form application - C# Training
Windows form application - C# Training Windows form application - C# Training
Windows form application - C# Training
 
c#.Net Windows application
c#.Net Windows application c#.Net Windows application
c#.Net Windows application
 
Object-oriented Programming-with C#
Object-oriented Programming-with C#Object-oriented Programming-with C#
Object-oriented Programming-with C#
 
.NET and C# Introduction
.NET and C# Introduction.NET and C# Introduction
.NET and C# Introduction
 
Developing an ASP.NET Web Application
Developing an ASP.NET Web ApplicationDeveloping an ASP.NET Web Application
Developing an ASP.NET Web Application
 
.Net framework
.Net framework.Net framework
.Net framework
 
Introduction to c programming
Introduction to c programmingIntroduction to c programming
Introduction to c programming
 
C# Exceptions Handling
C# Exceptions Handling C# Exceptions Handling
C# Exceptions Handling
 
Regular expression in javascript
Regular expression in javascriptRegular expression in javascript
Regular expression in javascript
 
Visula C# Programming Lecture 1
Visula C# Programming Lecture 1Visula C# Programming Lecture 1
Visula C# Programming Lecture 1
 
Presentation on C++ Programming Language
Presentation on C++ Programming LanguagePresentation on C++ Programming Language
Presentation on C++ Programming Language
 
c# usage,applications and advantages
c# usage,applications and advantages c# usage,applications and advantages
c# usage,applications and advantages
 
Python multithreaded programming
Python   multithreaded programmingPython   multithreaded programming
Python multithreaded programming
 
Static typing vs dynamic typing languages
Static typing vs dynamic typing languagesStatic typing vs dynamic typing languages
Static typing vs dynamic typing languages
 
Lecture 1 introduction to vb.net
Lecture 1   introduction to vb.netLecture 1   introduction to vb.net
Lecture 1 introduction to vb.net
 

Ähnlich wie 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