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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Article by: jpaulino
XML Literals are a great way to handle XML files and the community doesn’t use it as much as it should.  An XML Literal is like a String (http://msdn.microsoft.com/en-us/library/system.string.aspx) Literal, only instead of starting and ending with w…
A while ago, I was working on a Windows Forms application and I needed a special label control with reflection (glass) effect to show some titles in a stylish way. I've always enjoyed working with graphics, but it's never too clever to re-invent …
Along with being a a promotional video for my three-day Annielytics Dashboard Seminor, this Micro Tutorial is an intro to Google Analytics API data.
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.

863 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

22 Experts available now in Live!

Get 1:1 Help Now