Results 1 to 6 of 6

Thread: VB for dummies (me)

  1. #1
    New Member
    Join Date
    Aug 12
    Posts
    3

    VB for dummies (me)

    Hi All,
    I am very new to VB and have been through several books and countless hours and I need a little direction. I am trying to make a kind of scheduling program. It would allow the user via combo box to select a room. Once the room is selected, they would be able to input the time they would have the room. All of the rooms scheduled rooms would then display on a report page. Once the scheduled time has passed, I would like to be able to delete the entry or have it auto delete.

    So far I have made and XML file and used it to populate the combo box. I am not sure where to go from here.

    Thanks,

  2. #2
    Fanatic Member ThomasJohnsen's Avatar
    Join Date
    Jul 10
    Location
    Denmark
    Posts
    521

    Re: VB for dummies (me)

    (doh - asked about your version and you clearly specified it. Early morning here is my only excuse )
    And second - it might be a good idea to include a little bit of code, so we can see how advanced you are.

    For instance - can an example or help include datasets and databinding (ie. are you familiar with tables, fields/columns and datatypes).
    Last edited by ThomasJohnsen; Aug 5th, 2012 at 03:20 AM.
    In truth, a mature man who uses hair-oil, unless medicinally , that man has probably got a quoggy spot in him somewhere. As a general rule, he can't amount to much in his totality. (Melville: Moby Dick)

  3. #3
    New Member
    Join Date
    Aug 12
    Posts
    3

    Re: VB for dummies (me)

    Thanks for the reply. I am still in the phase of examining what other people have created. I just finished the book Visual Basic 2010 in 24 hours. (I think I may need another 24 hours) I am as new as you can get. I spend about 3 hours a day and some things are beginning to make sense. I have been at this for about two weeks. Sorry, I know it is not that much to go on.

  4. #4
    New Member
    Join Date
    Aug 12
    Posts
    3

    Re: VB for dummies (me)

    BTW, Thumb Wars is hilarious.

  5. #5
    New Member
    Join Date
    Jul 12
    Posts
    3

    Re: VB for dummies (me)

    Just out of curiosity which VB book are you using?

  6. #6
    Fanatic Member ThomasJohnsen's Avatar
    Join Date
    Jul 10
    Location
    Denmark
    Posts
    521

    Re: VB for dummies (me)

    I actually started making a well-commented example on using the DataSet (Initialization, Loading/Saving data to/from XML, Binding DataSets to Controls), but it quickly became a long example with alot of comments, that most likely would seem overwhelming. Instead I decided to point you in the right direction (IMO) by giving you a couple of pointers:

    In my opinion, the DataSet could really help you with your little example, because:
    1) It keeps data structured in rows in tables, and you can declare a DataSet object directly in your Form (ie. it's an object in the toolbox, meaning you don't have to have alot of variables to keep track of scheduling, rooms etc. - this can be a huge advantage when starting out, since it will keep the code simple and easy to overlook).
    2) It will allow you to save/load all your data to XML using a single line of code + selecting parts of the data for export or display and importing additional data is easy.
    3) DataSets and tables can be linked to controls (databinding), so for instance a ComboBox automatically displays all rooms available in the table Room (or when you get a little bit more advanced, you can select whichever parts of data you want displayed - ie. for instance all rooms not scheduled for use on a certain date).
    4) Understanding DataSets could be a huge aid when you begin to move towards more advanced programs, since it is similar in structure to databases.

    Explanation of datasets from MSDN link (NOTE: The examples here are short, and this link should probably be used more as a lookup-table instead of a place to learn about how to use datasets).
    I wasn't able to find a decent example here on using untyped datasets, but searching on google should provide the neccessary info.
    In the 101 VB.Net samples, that can be freely downloaded from MSDN, I'm sure you'll find alot of inspiration (at least 2 examples apply to untyped datasets and databinding, and there are loads of other neat examples).

    My suggestion is to make 2 tables in your dataset (should you choose to try them out):
    Table "Rooms"
    - Column RoomID - Int32 or Long, PrimaryKey, autogenerated.
    - Column RoomName - String (probably with allowdbnull false).
    Table "Bookings"
    - Column BookingID - Int32 or Long, PrimaryKey, autogenerated.
    - Column RoomID - Int32 {Refers to the Rooms table, column RoomID by a CascadeDelete relation}.
    - Column BookingDate - DateTime.
    - Column BookingLength - Single or Double (or maybe just Int32)

    Those 2 tables should suffice to make a useable booking example.

    Anyways - long post from me promoting DataSets.
    Regards Tom
    In truth, a mature man who uses hair-oil, unless medicinally , that man has probably got a quoggy spot in him somewhere. As a general rule, he can't amount to much in his totality. (Melville: Moby Dick)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •