Solved

Selecting rows from Table- VB.Net code behind

Posted on 2011-09-14
4
250 Views
Last Modified: 2012-05-12
I retrieved a table from data base and want to retrieve rows from table in the vb.net code class
I tried the following line and it is giving the error.

ID,IsActive and displayorder are column names in the table.

Rows = TblLoanRates.Select("[ID] = "&1"  AND [IsActive] = "&1",displayorder ASC")

The error is: Comma,or a valid expression continuation expected.

Thanks.
0
Comment
Question by:KavyaVS
[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
4 Comments
 
LVL 25

Accepted Solution

by:
Luis Pérez earned 250 total points
ID: 36535871
Replace your double quotes for simple quotes (inside the where sentence), and separate the order sentence from the where sentence:

Rows = TblLoanRates.Select("[ID] = '&1'  AND [IsActive] = '&1'", "displayorder ASC")

Hope that helps.
0
 

Author Comment

by:KavyaVS
ID: 36538291
I tried your answer.It is giving following error.
EvaluateException was unhandled by user code.

Rows = TblLoanRates.Select("[ID] = '&1'  AND [IsActive] = '&1'", "displayorder ASC")

Cannot perform '=' operation on System.Int32 and System.String.

ID  and displayorder colums data type int.IsActive is bit type.

Please let me know how to fix it.
Thanks
0
 
LVL 83

Assisted Solution

by:CodeCruiser
CodeCruiser earned 250 total points
ID: 36570580
Try this

Rows = TblLoanRates.Select("[ID] = " & 1 & "  AND [IsActive] = " & 1, "displayorder ASC")


0
 

Author Closing Comment

by:KavyaVS
ID: 36940289
Thanks
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
CHANGE FORM TEXT BEFORE IT SHOW TO USER 13 35
How do i create a simple array in a public class? 6 37
Updating Printer Details in VB.Net 16 43
EMAIL RANGES BASED ON CURRENT TIME 12 41
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…
Microsoft Reports are based on a report definition, which is an XML file that describes data and layout for the report, with a different extension. You can create a client-side report definition language (*.rdlc) file with Visual Studio, and build g…
Are you ready to implement Active Directory best practices without reading 300+ pages? You're in luck. In this webinar hosted by Skyport Systems, you gain insight into Microsoft's latest comprehensive guide, with tips on the best and easiest way…

751 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