Zum Inhalt springen
View in the app

A better way to browse. Learn more.

Fachinformatiker.de

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

.Net und Sql2005 - Tabellen erstellen

Empfohlene Antworten

Veröffentlicht

Hallo,

ich habe mal eine eigentlich sehr simple Frage... (denke ich ;))

und zwar hab ich folgendes Problem... ich bin seit kurzem auf .net studio 2005 (Framework 2.0) umgestiegen und muss in meinem Projekt jetzt auf einem sql2005-Server eine Tabelle erstellen, löschen etc. Mein Problem ist nun...wie mach ich das?

Ich bin im mom in meinem Code so weit...

Dim connectionString As String = "Hier steht mein Con-String"

Dim sqlString As String


sqlString = "CREATE TABLE Testtabelle(Datum datetime)"


Using con As New SqlClient.SqlConnection(connectionString)

  con.Open()



End Using

Also die Connection habe ich schonmal aufgebaut...nur wie erstelle ich jetzt eine Tabelle?

Vielen Dank schonmal! :)

Achso...und dann hätte ich noch eine Frage... ist es irgendwie möglich, dass ich das ganze Datenbankunabhängig mache? Hatte deswegen schonmal etwas mit Nhibernate rumprobiert...allerdings, wenn ich das richtig verstanden habe, braucht man dort ja für jede Tabelle eine XML-Datei...mein Problem ist allerdings, dass ich nicht weiss, was für Tabellen erstellt werden, wie die aussehen usw..

Du erstellst einen SqlCommand übergibts ihm den statement und die connection...

dann rufst du die Methode ExecuteNonQuerry von dem SqlCommand auf, dan führt er das aus.

Try + catches sind sinnvoll

Vielen Dank! :)

Archiv

Dieses Thema wurde archiviert und kann nicht mehr beantwortet werden.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.