1 / 12

Golf3000

Golf3000. Datenbankhandling. Einleitung. Vorstellung Team Eckdaten des Projekts Technischer Hintergrund Datenbanksystem ERD Datenbankanbindung. Das Projekt. Administrationssoftware für Golfclub Fortuna Nirgendwo Verwaltung Mitglieder, Turniere, Golfshop. Technischer Hintergrund. C#

raine
Download Presentation

Golf3000

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. Golf3000 Datenbankhandling

  2. Einleitung • Vorstellung Team • Eckdaten des Projekts • Technischer Hintergrund • Datenbanksystem • ERD • Datenbankanbindung

  3. Das Projekt • Administrationssoftware für Golfclub Fortuna Nirgendwo • Verwaltung Mitglieder, Turniere, Golfshop

  4. Technischer Hintergrund • C# • SQL Server 2008R2

  5. Datenbanksystem • Microsoft SQL Server 2008R2 • DB Name golf3000 • Anwendungsbenutzer: fortuna • Täglicher Wartungsplan • Export DUMP • Konsistenzprüfung • Reorganisation

  6. Datenbankanbindung - Connector • System.Data.SqlClient • .Net basiertes Framework für C# und SQL Server • Bereits verfügbar in Visual Studio Umgebung • Include bei Instanzierung

  7. Datenbankanbindung – Connection String con.ConnectionString= (“ Data Source=DBCLUSTER\\SQLEXPRESS; Initial Catalog = golf; Integrated Security = false; User ID = golf; Password= 12345; Connect Timeout = 3"); con.Open();

  8. Datenbankanbindung - Query Record in Datenbank einfügen stringquery = "INSERT INTO mitglied(mName, mVorname, mAdresseP, mAdressePnr, mAdresseG, mAdresseGnr, mGeburtsdatum, mBeschreibung, mLizenznr) VALUES "+ " ('" + txtName.Text + "','" + txtVorname.Text + "','" + txtAdressePrivat.Text + "','" + txtHausnummerPriv.Text + "','" + txtAdresseGesch.Text + "','" + txtHausnummerGesch.Text + "','" + txtGeburtsdatum.Text + "','" + txtBeschreibung.Text + "','" + txtLizenz.Text + "' )";

  9. Datenbankanbindung – Query absetzen SqlCommandcmd= new SqlCommand(query, con); Prüfen ob erfolgreichabgesetzt intintCheckQuery = cmd.ExecuteNonQuery(); if (intCheckQuery > 0) { MessageBox.Show("Datensatzerfolgreichhinzugefügt"); } else { MessageBox.Show("Datensatzkonntenichthinzugefügtwerden"); }

  10. Datenbankanbindung – Verbindung schliessen con.Close();

  11. Fragen ?

More Related