Link to home
Start Free TrialLog in
Avatar of Murray Brown
Murray BrownFlag for United Kingdom of Great Britain and Northern Ireland

asked on

VB.net load first 500 lines of DataTable

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")
ASKER CERTIFIED SOLUTION
Avatar of Éric Moreau
Éric Moreau
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Murray Brown

ASKER

Thanks