No announcement yet.

SQL: How to store data from custom graphical input...?

  • Filter
  • Time
  • Show
Clear All
new posts

  • SQL: How to store data from custom graphical input...?

    Hi all,

    Just though I'd throw this one out there, I've created a graphical input that I want to use as a booking / availability input :

    Click image for larger version

Name:	AvailDGV_2.JPG
Views:	1
Size:	66.1 KB
ID:	469822

    Basically names down the left dates along the top and you click and choose a status for given date... The front end works OK, little buggy at the moment but generally OK...

    The only way I can see to store all the info in a SQL database is literally enter all names all dates and all status's. Problem is this seems really long winded, messy and unnecessary, and on top of that reading the data back would be just nasty. I just wondered if anyone can suggest a better method for storing such info or how it should done??


    Last edited by QuattroDave; 28th January 2014, 13:27. Reason: title wasnt descriptive

  • #2
    Re: SQL: How to store data from custom graphical input...?

    What is the front end written in?

    Its more of a programming challenge than anything SQL, so you would need to get the grid cell and use that to convert into a name

    Roughly (and the 5 minute version)

    Array (2d) of statuses representing the cells
    Array (1d) of dates
    Array (1d) of names

    Use both 1d arrays to populate the headings

    When clicked, get grid in the form (x,y)
    Date = Dates(x)
    Name = Names(y)
    State = Status(x,y)
    SQL String becomes something like
    "UPDATE tblBookings SET bookdate = " & Date & ", bookname = '" & Name & "' bookstatus = '" & State & "'"

    Then use ADO to update database passing SQL String into it
    (note this is not exact, just a sort of ppseudocode.)
    Tom Jones
    MCT, MCSE (2000:Security & 2003), MCSA:Security & Messaging, MCDBA, MCDST, MCITP(EA, EMA, SA, EDA, ES, CS), MCTS, MCP, Sec+
    IT Trainer / Consultant
    Ossian Ltd

    ** Remember to give credit where credit is due and leave reputation points where appropriate **


    • #3
      Re: SQL: How to store data from custom graphical input...?


      Thanks for your reply, its written in VB.NET. I though it would probably be more of a programming challenge than a SQL one, but I had to ask in case there was something i hadn't though of or didn't know.

      The way I had though of was very similar to the way you described, it just doesn't seem to be a neat, clean solution. Its also rather clunky working out to update or insert a record....