Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Representing columns data in Visual Basic .Net from a SQL database

Posted on 2009-07-14
5
Medium Priority
?
208 Views
Last Modified: 2013-11-26
Hello,

I am writing a simple app in Visual Basic 2008 that will pull some data from a SQL database using a rather complex query and represent it in a form. Once this data is retrieved, a complex set of operations are carried out and displayed on another form in a similar tabular format

What is the best element to use to display this data (table, grid, etc). I know I can use datagridview, but i dont need the connection to be "live" - just extraction. Nothing needs to be written back to the database either. I imagine a listbox would work, but I would prefer that the end user have a simplistic excel-like interface.

Any example declarations would be greatly appreciated.

Thanks in advance.
0
Comment
Question by:ashbrookcorp
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
5 Comments
 
LVL 48

Assisted Solution

by:jpaulino
jpaulino earned 400 total points
ID: 24854702
>> but I would prefer that the end user have a simplistic excel-like interface.

But the DataGridView don't need to save the change back to the database. In fact you have to write some code in order to do that.
 
0
 
LVL 83

Accepted Solution

by:
CodeCruiser earned 1600 total points
ID: 24857856
As said by JPaulino, datagridview does not write back to the database automatically if you do not configure it to do so. So you can retrieve the data from the db into a datatable. Use that datatable as the datasource of the grid and any changes made would remain in the datatable.

Here is an example of how to load and display using datatable


dim dTable as new datatable
dim dbadp as new sqldataadapter("select * from tablename", connectionstring)
dbadp.fill(dTable)
dbadp.dispose
datagridview1.DataSource = dTable

Open in new window

0
 

Author Closing Comment

by:ashbrookcorp
ID: 31603491
More points awarded to codecruiser for providing example code.
0
 
LVL 48

Expert Comment

by:jpaulino
ID: 24872828
>> More points awarded to codecruiser for providing example code.
You didn't asked that :)
No problem ... glad I could help.
0
 

Author Comment

by:ashbrookcorp
ID: 24878050
yeah i did!

>> Any example declarations would be greatly appreciated.

No matter. You contribute some great stuff to this forum - plus you are in the hall of fame here man!! :) (congrats on #1, BTW)
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…

610 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question