Solved

Selecting rows from Table- VB.Net code behind

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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

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…
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…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

708 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now