Solved

Selecting rows from Table- VB.Net code behind

Posted on 2011-09-14
4
246 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
  • 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

Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

Question has a verified solution.

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

The ECB site provides FX rates for major currencies since its inception in 1999 in the form of an XML feed. The files have the following format (reducted for brevity) (CODE) There are three files available HERE (http://www.ecb.europa.eu/stats/exch…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

772 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