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.

a3quit4s

User
  • Registriert

  • Letzter Besuch

Lösungen

  1. a3quit4s's Beitrag in C# Null-Variable an MySQL übergeben wurde als Antwort markiert.   
    So, der Reihe nach.
    Das ist ganz, ganz schlechter Stil. Stichwort: SQL Injection
     
    Dinge benutzen die man nicht versteht ist immer schlecht.
    Das ganze nennt sich Conditional Operator.
     
    Zur Ursprungsfrage:
    Wenn Du deine Querys sauber parametrisiert hast kannst Du sowas machen:
    myCommandObject.Parameters.AddWithValue("@secret", string.IsNullOrWhiteSpace(secret) ? (object)DBNull.Value : secret); Was es tut:
    Der Conditional Operator prüft ob der String secret null, empty oder whitespace ist und übergibt in dem Fall DBNull.Value und falls er es nicht ist den String an den Parameter. Der Cast auf object ist notwendig da der Conditional Operator den Typen nicht erkennt, beide aber von object abgeleitet sind und damit die Generalisierung greift. 

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.