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
174 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
1 Comment
 
LVL 34

Accepted Solution

by:
Sancler earned 500 total points
Comment Utility
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

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

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.
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

763 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

10 Experts available now in Live!

Get 1:1 Help Now