Displaying Data From 3 SQL Tables On A Form

  • I have a program of my own, for my own use, written in Excel VBA that I want to rewrite in VB2010 Express using SQLCE.

    It currently displays a Form as per the picture attached.

    What is the best way of replicating something similar ? I know I can create individual Buttons & TextBoxes for each Row, but I am wondering if there is a better way. I tried using DataGridView, but (a) it's pretty ugly & (b) it doesn't let me use more than one Table !!!

    I don't mind using a load individual Buttons & TextBoxes, but thought I would ask people who might know better, before doing so 😉 !!!

  • gary.p.heath (3/5/2013)


    I have a program of my own, for my own use, written in Excel VBA that I want to rewrite in VB2010 Express using SQLCE.

    It currently displays a Form as per the picture attached.

    What is the best way of replicating something similar ? I know I can create individual Buttons & TextBoxes for each Row, but I am wondering if there is a better way. I tried using DataGridView, but (a) it's pretty ugly & (b) it doesn't let me use more than one Table !!!

    I don't mind using a load individual Buttons & TextBoxes, but thought I would ask people who might know better, before doing so 😉 !!!

    You need a lot more details before anybody has much chance of offering you any real help. I would think that a grid would be a good approach but it is awfully hard to tell what you are doing with nothing more than a screenshot of stuff. We can't tell what is going on with that.

    _______________________________________________________________

    Need help? Help us help you.

    Read the article at http://www.sqlservercentral.com/articles/Best+Practices/61537/ for best practices on asking questions.

    Need to split a string? Try Jeff Modens splitter http://www.sqlservercentral.com/articles/Tally+Table/72993/.

    Cross Tabs and Pivots, Part 1 – Converting Rows to Columns - http://www.sqlservercentral.com/articles/T-SQL/63681/
    Cross Tabs and Pivots, Part 2 - Dynamic Cross Tabs - http://www.sqlservercentral.com/articles/Crosstab/65048/
    Understanding and Using APPLY (Part 1) - http://www.sqlservercentral.com/articles/APPLY/69953/
    Understanding and Using APPLY (Part 2) - http://www.sqlservercentral.com/articles/APPLY/69954/

  • Sean, to be honest, I'm not looking for people to write this for me (though it would be nice and save me days, if not weeks, of hassle & stress), I have put the picture there to show you what I do now ... in Excel VBA.

    I like the layout, I like the way the background is visible around it, but I realise it is not the best / most logical / most efficient way of doing things.

    As I have pointed out, I don't like the DataGridView option, even before its single Table limitations, so I am asking for opinions and suggestions of (IF there are any) any way of doing something similar.

    I click on the button on the left and that takes the data from the TextBoxes on that Row and processes them, I can and will handle all of that, it is SQL that I really struggle with and why I am asking for help here ...

    If there isn't an alternative to me saying "Create a Row of Button, TextBox, TextBox, TextBox for every League" then that's fine, I am happy to do that ... I am just checking (hoping ?) that Microsoft are moving away from ugly options !!!

  • Well DataGridViews are limited to a single datasource, this does not mean that the datasource can't have data from more than 1 sql table. I know you aren't looking for somebody to write it for you but it is difficult to offer much suggestions.

    If you want to keep the background peeking through stuff like you currently do then a DataGrid is not the answer. You may have to add rows of controls to your form. Depending on the situation you can do this dynamically.

    If each of the "rows" needs to have all the same controls you might look into creating a user control with the necessary functionality. Then you only need to add 1 of those controls for each row.

    _______________________________________________________________

    Need help? Help us help you.

    Read the article at http://www.sqlservercentral.com/articles/Best+Practices/61537/ for best practices on asking questions.

    Need to split a string? Try Jeff Modens splitter http://www.sqlservercentral.com/articles/Tally+Table/72993/.

    Cross Tabs and Pivots, Part 1 – Converting Rows to Columns - http://www.sqlservercentral.com/articles/T-SQL/63681/
    Cross Tabs and Pivots, Part 2 - Dynamic Cross Tabs - http://www.sqlservercentral.com/articles/Crosstab/65048/
    Understanding and Using APPLY (Part 1) - http://www.sqlservercentral.com/articles/APPLY/69953/
    Understanding and Using APPLY (Part 2) - http://www.sqlservercentral.com/articles/APPLY/69954/

  • Thanks for your help Sean, I'm looking at that now ...

Viewing 5 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic. Login to reply