?
Solved

Query as Datasource for Datagridview: Query not Listed as an Option

Posted on 2008-06-23
3
Medium Priority
?
387 Views
Last Modified: 2013-11-26
In Visual Basic 2008, I have a simple form with a Datagridview control.  I have a project dataset in which I have attached perhaps 20 tables from my SqlServer Database.  I have made a query that joins 2 tables and there is a query table adapter shown in the dataset explorer, and the query table adapter shows my query, named Lookupvisits().  On the Datagridview, when I click on "choose data source" and I expand the tree structure of my project datasources, the query is not shown.  What am I doing wrong? of note, when I click on the query properties, the execute mode property shows 'scalar'- "reader" is not an option, if that matters.  Thank you.
0
Comment
Question by:SqlServerDoc
[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
3 Comments
 
LVL 41

Accepted Solution

by:
graye earned 500 total points
ID: 21846030
When you built the query in the DataSet designer, did you use the "Query" object or the "TableAdapter" object?

It may seem a bit counter-intuitive, but if your query returns a table, you should use a TableAdapter rather than a Query
0
 

Author Closing Comment

by:SqlServerDoc
ID: 31469714
Excellent.  I wish there was better documentation (msdn etc) available! thank you!
0
 

Author Comment

by:SqlServerDoc
ID: 21846201
For other beginners, when defining a query datasource in the designer, click on Add > Table Adapter rather than query.
0

Featured Post

Enroll in August's Course of the Month

August's CompTIA IT Fundamentals course includes 19 hours of basic computer principle modules and prepares you for the certification exam. It's free for Premium Members, Team Accounts, and Qualified Experts!

Question has a verified solution.

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

Today I had a very interesting conundrum that had to get solved quickly. Needless to say, it wasn't resolved quickly because when we needed it we were very rushed, but as soon as the conference call was over and I took a step back I saw the correct …
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…
Suggested Courses

765 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