Solved

How to resolve an error where a table that is contained in a defined dataset is not a member of System.Data.Dataset

Posted on 2006-11-08
1
179 Views
Last Modified: 2010-04-23
I'm experiencing a problem where I'm attempting to use a table that is defined to a dataset, yet receiving an error message indicating that the table is not part of System.Data.Dataset.  Below please find the code snippet that is generating the error:

    Dim cmdACSelect As New OleDbCommand("SELECT intCandidateAnswerChoiceSysID, intCandidateQuestionSysID FROM tblCandidateQuesHasAnswers WHERE tblCandidateQuesHasAnswers.intCandidateQuestionSysID = " & CInt(strcqid) & "AND" & tblCandidateQuesHasAnswers.intCandidateQuestionSysID = " & CInt(strcqcollect)", OleDbConnection1)

The dataset that contains this table, tblCandidateQuesHasAnswers is dsAnswerChoices which has been included with the form.  

I'm also receiving a related error indicating that the tblCandidateQuesHasAnswers is not declared.

Any assistance that you can offer to resolve this would be greatly appreciated.

Thanks!

Barbara
0
Comment
Question by:barbmick
[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
1 Comment
 
LVL 34

Accepted Solution

by:
Sancler earned 500 total points
ID: 17902652
There's something very odd about the line you quote.

First, I think the quotes are in the wrong places.  I think the quote after AND needs to go and so does the one after CInt(strcqcollect).

Once you have corrected that, all references to tblCandidateQuesHasAnswers will be within the quotes.  That means that they will be instructions to the parser, referring to a table in the database not in your app's dataset, so the particular error you are reporting will not happen on this line.

The other thing I find odd - although I don't think it is anything to do with the problem you're reporting - is that you are testing the same field - intCandidateQuestionSysID - against two values from two different sources - strcqid and strcqcollect.  There is no "rule" against doing that, but my approach would be first to test whether those values were the same.  If they're not, the test at the database end will return nothing, so why bother to make it?  And if they are the same, why bother to test both of them?

Roger
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

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

Introduction When many people think of the WebBrowser (http://msdn.microsoft.com/en-us/library/2te2y1x6%28v=VS.85%29.aspx) control, they immediately think of a control which allows the viewing and navigation of web pages. While this is true, it's a…
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…
Come and listen to Percona CEO Peter Zaitsev discuss what’s new in Percona open source software, including Percona Server for MySQL (https://www.percona.com/software/mysql-database/percona-server) and MongoDB (https://www.percona.com/software/mongo-…
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…

691 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