Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

Troubleshooting
Research
Professional Opinions
Ask a Question
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE

troubleshooting Question

Dataset that selects first 100 records

Avatar of jedistar
jedistarFlag for Singapore asked on
Databases
11 Comments1 Solution720 ViewsLast Modified:
Hi,

My dataset always retrieves up to 1000+ records which is overwhelming
How do i display only first 100 records and not show the rest.

I use Microsoft Indexing Server and ASP.NET code to do:

    Dim strQuery As String
    strQuery = "select top 100 doctitle, size, write, path, rank, characterization from scope() where FREETEXT(Contents, '" & strSearch & "') order by rank desc"

    Dim connString As String = "Provider=MSIDXS.1;Integrated Security .='';Data Source='" & strCatalog & "'"


Error:
Incorrect syntax near '100'.  Expected ',', '.', FROM. SQLSTATE=42000
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Data.OleDb.OleDbException: Incorrect syntax near '100'.  Expected ',', '.', FROM. SQLSTATE=42000

Anyone knows?

Thanks!
ASKER CERTIFIED SOLUTION
Avatar of imrancs
imrancsFlag of Pakistan image

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Commented:
This problem has been solved!
Unlock 1 Answer and 11 Comments.
See Answers