Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. WPF C# Selected Row from a Listbox in the Database

WPF C# Selected Row from a Listbox in the Database

Scheduled Pinned Locked Moved C#
csharpdatabasewpfhelpmysql
6 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D Offline
    D Offline
    Diane Dolinski
    wrote on last edited by
    #1

    Hi at all Im new in C# WPF and SQL since days im sitting on a problem I could not solve, and hope of help but fdid not find the Problem, because I'm not so good in sql: I try to delete(Löschen) a Dataset from Listbox and the Database behind(MySQL), and i do not find my failure. Please can you help me? I tried to send a Screenshot, but dont find a way.... Thanks for your help XAML-Code

    L M 2 Replies Last reply
    0
    • D Diane Dolinski

      Hi at all Im new in C# WPF and SQL since days im sitting on a problem I could not solve, and hope of help but fdid not find the Problem, because I'm not so good in sql: I try to delete(Löschen) a Dataset from Listbox and the Database behind(MySQL), and i do not find my failure. Please can you help me? I tried to send a Screenshot, but dont find a way.... Thanks for your help XAML-Code

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      You should put your "start up code" in the MainWindow Loaded event; there are too many side effects when you do too much in the "constructor" of the main window (or any window for that matter).

      "Before entering on an understanding, I have meditated for a long time, and have foreseen what might happen. It is not genius which reveals to me suddenly, secretly, what I have to say or to do in a circumstance unexpected by other people; it is reflection, it is meditation." - Napoleon I

      D 1 Reply Last reply
      0
      • L Lost User

        You should put your "start up code" in the MainWindow Loaded event; there are too many side effects when you do too much in the "constructor" of the main window (or any window for that matter).

        "Before entering on an understanding, I have meditated for a long time, and have foreseen what might happen. It is not genius which reveals to me suddenly, secretly, what I have to say or to do in a circumstance unexpected by other people; it is reflection, it is meditation." - Napoleon I

        D Offline
        D Offline
        Diane Dolinski
        wrote on last edited by
        #3

        That's a good tip, thanks... As for my background, I'm 56 and what other crosswords are, C# is to me. I'm currently learning C# with books, but unfortunately they are very buggy and I just can't find the bug: Database error! System.FormatException The input string is in the wrong format

        1 Reply Last reply
        0
        • D Diane Dolinski

          Hi at all Im new in C# WPF and SQL since days im sitting on a problem I could not solve, and hope of help but fdid not find the Problem, because I'm not so good in sql: I try to delete(Löschen) a Dataset from Listbox and the Database behind(MySQL), and i do not find my failure. Please can you help me? I tried to send a Screenshot, but dont find a way.... Thanks for your help XAML-Code

          M Offline
          M Offline
          Mycroft Holmes
          wrote on last edited by
          #4

          Test the value of:

          Int32.Parse(lbArtikel.SelectedValue.ToString()));

          I would guess it is probably null.

          Never underestimate the power of human stupidity - RAH I'm old. I know stuff - JSOP

          D 2 Replies Last reply
          0
          • M Mycroft Holmes

            Test the value of:

            Int32.Parse(lbArtikel.SelectedValue.ToString()));

            I would guess it is probably null.

            Never underestimate the power of human stupidity - RAH I'm old. I know stuff - JSOP

            D Offline
            D Offline
            Diane Dolinski
            wrote on last edited by
            #5

            Hello thanks, im looking around to learn anything about the parsing?, an howto with examples, better than the microsoft site?

            1 Reply Last reply
            0
            • M Mycroft Holmes

              Test the value of:

              Int32.Parse(lbArtikel.SelectedValue.ToString()));

              I would guess it is probably null.

              Never underestimate the power of human stupidity - RAH I'm old. I know stuff - JSOP

              D Offline
              D Offline
              Diane Dolinski
              wrote on last edited by
              #6

              Yes, that's it, but now I must find a way to solve my problem thank you for the tip oh, thats a very good side to learn for all beginners like me https://www.dotnetperls.com/parse

              1 Reply Last reply
              0
              Reply
              • Reply as topic
              Log in to reply
              • Oldest to Newest
              • Newest to Oldest
              • Most Votes


              • Login

              • Don't have an account? Register

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • World
              • Users
              • Groups