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.

datagridview1 nach ändern speichern

Empfohlene Antworten

Veröffentlicht

Hallo Leute

Habe noch ein kleines Problem.

Ich befülle mit folgendem Code ein Datagridview. Wenn Ich jetzt im datagridview Daten ändere werden die nicht gepeichert. Wie geht das Speichern der Daten nach dem ändern. Habe was von update gelesen komm aber nicht klar damit. Wer hat mir einen Tipp ? Danke

Dim dt As New DataTable

Dim da As OleDb.OleDbDataAdapter

Dim ds As New DataSet

Dim bs As New BindingSource

ds.Tables.Add(dt)

da = New OleDb.OleDbDataAdapter("select spielernr,name,vorname from jassen", con_ja)

da.Fill(dt)

Dim cb As New OleDb.OleDbCommandBuilder(da)

bs.DataSource = dt

DataGridView1.DataSource = bs

Habe das Problem selbst gelöst.

Danke

Floh-2001

Sorry, hab Ich vergessen , hier meine lösung

'datagrid füllen

Private Sub stamm_dbf__Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

Dim Pfad1 As String = ofd.FileName

Dim Ordner_st As String

Dim a()

a = Split(Pfad1, "\")

Ordner_st = ofd.InitialDirectory & (a(UBound(a) - 1)) & "\stammdaten.mdb"

Dim Con_st As String = "Provider = Microsoft.jet.oledb.4.0;" & "Data source =" & Ordner_st

Dim Con As New OleDbConnection(Con_st)

ds_st.Tables.Add(dt_st)

da_st = New OleDbDataAdapter("SELECT * FROM stammdaten", Con_st)

da_st.Fill(dt_st)

Dim cb As New OleDbCommandBuilder(da_st)

bs_st.DataSource = dt_st

DataGrid_stamm.DataSource = bs_st

End Sub

'datengrid mit Beendenbutton verlassen und Daten speichern

Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click

If ds_st.HasChanges Then

If MsgBox("Änderungen speichern?", MsgBoxStyle.Question Or MsgBoxStyle.YesNo) Then

bs_st.EndEdit()

da_st.Update(ds_st.Tables(0))

End If

End If

end sub

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.