Solved

How to retrieve data in vb.net 2010

Posted on 2012-03-27
6
266 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
  • 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
What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

 
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

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

Creating an analog clock UserControl seems fairly straight forward.  It is, after all, essentially just a circle with several lines in it!  Two common approaches for rendering an analog clock typically involve either manually calculating points with…
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

706 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now