Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Selecting rows from Table- VB.Net code behind

Posted on 2011-09-14
4
Medium Priority
?
254 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 1000 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 1000 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

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

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

Since .Net 2.0, Visual Basic has made it easy to create a splash screen and set it via the "Splash Screen" drop down in the Project Properties.  A splash screen set in this manner is automatically created, displayed and closed by the framework itsel…
It’s quite interesting for me as I worked with Excel using vb.net for some time. Here are some topics which I know want to share with others whom this might help. First of all if you are working with Excel then you need to Download the Following …
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …
Suggested Courses

715 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