Solved

How to retrieve data in vb.net 2010

Posted on 2012-03-27
6
270 Views
Last Modified: 2012-06-27
Hi Experts,

How to retrieve data from database and display it in the grid from the selected values?

Thanks!!
0
Comment
Question by:developer2012
[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
  • 3
  • 2
6 Comments
 
LVL 9

Accepted Solution

by:
TonyReba earned 250 total points
ID: 37771770
0
 
LVL 83

Expert Comment

by:CodeCruiser
ID: 37772149
>from the selected values?

What you mean by that?
0
 

Author Comment

by:developer2012
ID: 37772917
@ Code Cruiser: Selected Value: For instance user selects values (dates) from the application and time. When the user clicks show button. The data is displayed.Thanks.
0
Salesforce Made Easy to Use

On-screen guidance at the moment of need enables you & your employees to focus on the core, you can now boost your adoption rates swiftly and simply with one easy tool.

 
LVL 83

Assisted Solution

by:CodeCruiser
CodeCruiser earned 250 total points
ID: 37774061
So you want to load data based on filter. Without knowing much details about your requirements, here is a sample

Dim dbadp As New SqlDataAdapter("Select * From MyTable Where MyColumn = '" & txtName.Text & "'", "Your connection string goes here")
Dim dTable As New DataTable
dbadp.Fill(dTable)
dbadp.Dispose
DataGridView1.DataSource = dTable

Open in new window



If you need further help, show us a screenshot of your form and provide more details.
0
 

Author Comment

by:developer2012
ID: 37778291
Doc1.docx

Here is the screen shot for the question.  Thanks!!.

And how do I display the data in TExtBox When the user clicks on View Report. IT is generated in textbox not in the datagrid. Thanks
0
 
LVL 83

Expert Comment

by:CodeCruiser
ID: 37866840
So it only returns one value? Or a list of values? If list then you would need to use a control like repeater, gridview, datalist etc to show the list. If one value then you can use command object to do a ExecuteScalar() and get single value.
0

Featured Post

Secure Your Active Directory - April 20, 2017

Active Directory plays a critical role in your company’s IT infrastructure and keeping it secure in today’s hacker-infested world is a must.
Microsoft published 300+ pages of guidance, but who has the time, money, and resources to implement? Register now to find an easier way.

Question has a verified solution.

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

In my previous article (http://www.experts-exchange.com/Programming/Languages/.NET/.NET_Framework_3.x/A_4362-Serialization-in-NET-1.html) we saw the basics of serialization and how types/objects can be serialized to Binary format. In this blog we wi…
Today I had a very interesting conundrum that had to get solved quickly. Needless to say, it wasn't resolved quickly because when we needed it we were very rushed, but as soon as the conference call was over and I took a step back I saw the correct …
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

730 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