Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

Displaying Data From 3 SQL Tables On A Form Expand / Collapse
Author
Message
Posted Tuesday, March 5, 2013 11:23 AM
Grasshopper

GrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopper

Group: General Forum Members
Last Login: Saturday, February 8, 2014 12:28 PM
Points: 22, Visits: 56
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 !!!


  Post Attachments 
ScreenHunter_306 Mar. 05 17.48.jpg (20 views, 106.73 KB)
Post #1426955
Posted Tuesday, March 5, 2013 12:36 PM


SSChampion

SSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampion

Group: General Forum Members
Last Login: Yesterday @ 9:26 PM
Points: 12,990, Visits: 12,398
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 Moden's splitter.

Cross Tabs and Pivots, Part 1 – Converting Rows to Columns
Cross Tabs and Pivots, Part 2 - Dynamic Cross Tabs
Understanding and Using APPLY (Part 1)
Understanding and Using APPLY (Part 2)
Post #1426989
Posted Tuesday, March 5, 2013 3:43 PM
Grasshopper

GrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopper

Group: General Forum Members
Last Login: Saturday, February 8, 2014 12:28 PM
Points: 22, Visits: 56
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 !!!

Post #1427065
Posted Wednesday, March 6, 2013 7:25 AM


SSChampion

SSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampion

Group: General Forum Members
Last Login: Yesterday @ 9:26 PM
Points: 12,990, Visits: 12,398
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 Moden's splitter.

Cross Tabs and Pivots, Part 1 – Converting Rows to Columns
Cross Tabs and Pivots, Part 2 - Dynamic Cross Tabs
Understanding and Using APPLY (Part 1)
Understanding and Using APPLY (Part 2)
Post #1427388
Posted Wednesday, March 6, 2013 11:33 AM
Grasshopper

GrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopper

Group: General Forum Members
Last Login: Saturday, February 8, 2014 12:28 PM
Points: 22, Visits: 56
Thanks for your help Sean, I'm looking at that now ...
Post #1427551
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse