SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Displaying Data From 3 SQL Tables On A Form


Displaying Data From 3 SQL Tables On A Form

Author
Message
gary.p.heath
gary.p.heath
SSC-Enthusiastic
SSC-Enthusiastic (120 reputation)SSC-Enthusiastic (120 reputation)SSC-Enthusiastic (120 reputation)SSC-Enthusiastic (120 reputation)SSC-Enthusiastic (120 reputation)SSC-Enthusiastic (120 reputation)SSC-Enthusiastic (120 reputation)SSC-Enthusiastic (120 reputation)

Group: General Forum Members
Points: 120 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 ;-) !!!
Attachments
ScreenHunter_306 Mar. 05 17.48.jpg (26 views, 106.00 KB)
Sean Lange
Sean Lange
SSC Guru
SSC Guru (62K reputation)SSC Guru (62K reputation)SSC Guru (62K reputation)SSC Guru (62K reputation)SSC Guru (62K reputation)SSC Guru (62K reputation)SSC Guru (62K reputation)SSC Guru (62K reputation)

Group: General Forum Members
Points: 62607 Visits: 17959
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.

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)
gary.p.heath
gary.p.heath
SSC-Enthusiastic
SSC-Enthusiastic (120 reputation)SSC-Enthusiastic (120 reputation)SSC-Enthusiastic (120 reputation)SSC-Enthusiastic (120 reputation)SSC-Enthusiastic (120 reputation)SSC-Enthusiastic (120 reputation)SSC-Enthusiastic (120 reputation)SSC-Enthusiastic (120 reputation)

Group: General Forum Members
Points: 120 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 !!!
Sean Lange
Sean Lange
SSC Guru
SSC Guru (62K reputation)SSC Guru (62K reputation)SSC Guru (62K reputation)SSC Guru (62K reputation)SSC Guru (62K reputation)SSC Guru (62K reputation)SSC Guru (62K reputation)SSC Guru (62K reputation)

Group: General Forum Members
Points: 62607 Visits: 17959
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.

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)
gary.p.heath
gary.p.heath
SSC-Enthusiastic
SSC-Enthusiastic (120 reputation)SSC-Enthusiastic (120 reputation)SSC-Enthusiastic (120 reputation)SSC-Enthusiastic (120 reputation)SSC-Enthusiastic (120 reputation)SSC-Enthusiastic (120 reputation)SSC-Enthusiastic (120 reputation)SSC-Enthusiastic (120 reputation)

Group: General Forum Members
Points: 120 Visits: 56
Thanks for your help Sean, I'm looking at that now ...
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search