1 / 24

Murat ÇELİKADAM

Murat ÇELİKADAM. Querying Information in a Database. CONTENTS. Relational Database Systems Creating Database with SQL Server Reading Data with LINQ Requirements to Get Data From Database Step by Step Writing Data to on DataBase Summary Examples Questions.

edolie
Download Presentation

Murat ÇELİKADAM

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Murat ÇELİKADAM Querying Information in a Database

  2. CONTENTS • Relational Database Systems • Creating Database withSQL Server • Reading Data with LINQ • RequirementstoGet Data From Database Step by Step • Writing Data to on DataBase • Summary • Examples • Questions

  3. Relational Database Systems • Oracle •  FoxPro •  IBM DB2 • Linter •  Microsoft Access •  Microsoft SQLServer • MySQL • PostgreSQL • SQLite

  4. Creating Database withMySQL

  5. Creating Database withMySQL

  6. Creating Database withMySQL

  7. Creating Database withMySQL

  8. Creating Database withMySQL

  9. Reading Data withLINQ

  10. Reading Data with LINQ

  11. Reading Data with LINQ

  12. Reading Data with LINQ

  13. RequirementstoGet Data From Database Step byStep • AddingNamespace • Creating Connection andOpening it • DeterminetheSqlDataAdapter • Reading Data • Closing Connection

  14. AddingNamespace • System.Data.SqlClient (the.NET Framework Data Provider for SQL Server) • System.Data.Odbc (the.NET Framework Data Provider for ODBC) • System.Data.OracleClient(the .NET Framework Data Provider forOracle) • System.Data.OleDb (the.NET Framework Data Provider for OLE DB)

  15. Connection • The Connection Object is a part of ADO.NET Data Provider and it is a unique session with the Data Source • The Connection Object is Handling the part of physical communication between the C# application and the Data Source • Openingconnection is likeopening a folder

  16. Connection • SqlConnectionconn = newSqlConnection(); • Con.ConnectionString= @“…”; • Con.Open();

  17. SqlDataAdapter • A data adapteris an objectusedtoexchangedata between a data sourceand a data set

  18. SqlDataAdapter

  19. Reading Data andClosing Connection • DataGridViewdisplays data from SQL databases. • This tutorial shows how to display a specific table from a database and display it on a DataGridView. • This is done with a DataAdapter DataGridView.DataSource = DataTable; Conn.Close(); //Importanttocloseconnection

  20. Writing Data to on DataBase • UseSqlCommand • UseExecuteNonQuery stringKmt = "INSERT INTO Customers (CustomerID,CompanyName,ContactName,City) VALUES ('" + textBox1.Text + "','" + textBox2.Text + "', …) "; SqlCommandkomut = newSqlCommand(Kmt, baglanti); komut.ExecuteNonQuery();

More Related