Solved

VB.net load first 500 lines of DataTable

Posted on 2013-01-19
2
241 Views
Last Modified: 2013-01-19
Hi
I use the following code to populate a DataGridView.
Is it possible to load only the first 500 lines into the DataGridView


         Dim oConnectionString As String = Globals.ThisAddIn.oRIGHT.lblConnectionString.Text
                Dim con As SqlConnection = New SqlConnection(oConnectionString)
                Dim sSQL As String = Globals.ThisAddIn.oBOTTOM.txtSQL.Text
                con.Open()
                Dim da As SqlDataAdapter = New SqlDataAdapter(sSQL, con)
                da.Fill(ds, "MyTable")
                DataGridView1.DataSource = ds.Tables("MyTable")
0
Comment
Question by:Murray Brown
[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 Comments
 
LVL 70

Accepted Solution

by:
Éric Moreau earned 500 total points
ID: 38797014
can't you just change your sSQL to include a TOP 500 clause?
0
 

Author Closing Comment

by:Murray Brown
ID: 38797864
Thanks
0

Featured Post

PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

Question has a verified solution.

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

Article by: Kraeven
Introduction Remote Share is a simple remote sharing tool, enabling you to see, add and remove remote or local shares. The application is written in VB.NET targeting the .NET framework 2.0. The source code and the compiled programs have been in…
Introduction As chip makers focus on adding processor cores over increasing clock speed, developers need to utilize the features of modern CPUs.  One of the ways we can do this is by implementing parallel algorithms in our software.   One recent…
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…

696 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