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
176 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
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

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

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

This tutorial demonstrates one way to create an application that runs without any Forms but still has a GUI presence via an Icon in the System Tray. The magic lies in Inheriting from the ApplicationContext Class and passing that to Application.Ru…
Creating an analog clock UserControl seems fairly straight forward.  It is, after all, essentially just a circle with several lines in it!  Two common approaches for rendering an analog clock typically involve either manually calculating points with…
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…

785 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