none
Database application in VB 2015. RRS feed

  • Question

  • I am developing an database (SQL-SERVER) application IN VB 2015.

    1. I want to display patient's details in textboxes. (from Table patient).ON SAME FORM.

    2. A combo box showing dropdown list of various departments attached to hospital.(from table Department).ON SAME FORM.

    3. few text boxes showing Doctor's details from particular department selected in above Combo box.(a separate table of doctors attached to various departments).ON SAME FORM.

    Thursday, February 22, 2018 4:06 PM

Answers

  • Steps

    1. Write down (paper and pencil or whiteboard) the schema, refine it for the database along with how tables relate.
    2. If possible have someone review the above.
    3. Create the database, tables and relations.
    4. Place test data into the tables.
    5. Write SQL select statements to get to the data.
    6. Fix mistakes (there will be one or more in regards to the database schema).
    7. Got it right, do a backup on the database.

    Now you would plan out your data and business classes and user interface or simplify this to whatever level you want.

    How to work work with data in code.  Choices best to not great for windows forms and not any expertise in developing what you are after.

    • SqlClient data provider 
    • Entity Framework
    • DataAdapter
    • TableAdapter

    At this point you really should be writing data access code in classes. Refrain from creating any user interface but instead create unit test to ensure things work properly then create your UI.

    Usually this is where someone ask "is there an easier way", sure if you don't mind making mistakes upfront that mess things up because no planning was done and have to jury rig code then by all means go that route :-)

    EDIT some might ask, why write SQL when using Entity Framework? It's because you need to validate the schema no matter what method is used to access data e.g. any item in the list above as even Entity Framework at the very core does SQL.


    Please remember to mark the replies as answers if they help and unmark them if they provide no help, this will help others who are looking for solutions to the same or similar problem. Contact via my Twitter (Karen Payne) or Facebook (Karen Payne) via my MSDN profile but will not answer coding question on either.
    VB Forums - moderator
    profile for Karen Payne on Stack Exchange, a network of free, community-driven Q&A sites


    Thursday, February 22, 2018 7:00 PM
    Moderator

All replies

  • Hi

    And the question is ......................?


    Regards Les, Livingston, Scotland

    Thursday, February 22, 2018 4:12 PM
  • Steps

    1. Write down (paper and pencil or whiteboard) the schema, refine it for the database along with how tables relate.
    2. If possible have someone review the above.
    3. Create the database, tables and relations.
    4. Place test data into the tables.
    5. Write SQL select statements to get to the data.
    6. Fix mistakes (there will be one or more in regards to the database schema).
    7. Got it right, do a backup on the database.

    Now you would plan out your data and business classes and user interface or simplify this to whatever level you want.

    How to work work with data in code.  Choices best to not great for windows forms and not any expertise in developing what you are after.

    • SqlClient data provider 
    • Entity Framework
    • DataAdapter
    • TableAdapter

    At this point you really should be writing data access code in classes. Refrain from creating any user interface but instead create unit test to ensure things work properly then create your UI.

    Usually this is where someone ask "is there an easier way", sure if you don't mind making mistakes upfront that mess things up because no planning was done and have to jury rig code then by all means go that route :-)

    EDIT some might ask, why write SQL when using Entity Framework? It's because you need to validate the schema no matter what method is used to access data e.g. any item in the list above as even Entity Framework at the very core does SQL.


    Please remember to mark the replies as answers if they help and unmark them if they provide no help, this will help others who are looking for solutions to the same or similar problem. Contact via my Twitter (Karen Payne) or Facebook (Karen Payne) via my MSDN profile but will not answer coding question on either.
    VB Forums - moderator
    profile for Karen Payne on Stack Exchange, a network of free, community-driven Q&A sites


    Thursday, February 22, 2018 7:00 PM
    Moderator
  • Like Les I'm curious what you want from us. 

    This is so simple that a kid from 12 who had some basic education in VB .Net should be able to do that. 

    Be aware, this is not a place to order free software. 


    Success
    Cor

    Thursday, February 22, 2018 7:41 PM
  • This is not a question about the VB.Net language. It would be appropriate to put this question either in the WPF or Windows Forms forum. I will assume you are using WPF but if this is for Windows Forms then you should at least say that. The following are walkthroughs and such about using the Entity Framework.



    Sam Hobbs
    SimpleSamples.Info

    Thursday, February 22, 2018 7:48 PM