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.

vb.net bild in db speichern

Empfohlene Antworten

Veröffentlicht

hallo leute,

ich möchte ein bild in eine mssql2005-db speichern (bitte hier keine diskussion ob das sinnvoll ist oder nicht), weiß aber nicht recht wie ich angehen soll.

ich habe also den lokalen pfad des bildes "C:\...." wie speichere ich dann ber das bild als datei in der db?

die picturebox speichert ja auch nur einen verweis auf ein bild (soweit ich das jetzt richtig mitgekriegt hab).

danke

lg

jasso

Hi schau dir mal FileStream bzw. StreamReader an damit solltest du Dateien Binär auslesen können und dann eben in ein entsprechendes Feld in der Datenbank eintragen können

  • Autor

dankeschön für die tips.

hab mir alles mal angesehen und es im endeffekt so gemacht, dass ich mein image-feld in der db als typ-text deklariert und mein bild in base24 konvertiret habe.

für alle dies interessiert:

                        'image in base24-text konvertieren

                        Dim imagesource As Image

                        'image laden

                        imagesource = pb_logo.Image

                        Dim streamsource As MemoryStream

                        streamsource = New MemoryStream

                        'image in memorystream speichern

                        imagesource.Save(streamsource, ImageFormat.Bmp)

                        'image in text umwandeln

                        bild = Convert.ToBase64String(streamsource.ToArray())

lg

jasso

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.