?
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
Medium Priority
?
180 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 2000 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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

If you're writing a .NET application to connect to an Access .mdb database and use pre-existing queries that require parameters, you've come to the right place! Let's say the pre-existing query(qryCust) in Access takes a Date as a parameter and l…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
Michael from AdRem Software outlines event notifications and Automatic Corrective Actions in network monitoring. Automatic Corrective Actions are scripts, which can automatically run upon discovery of a certain undesirable condition in your network.…
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…
Suggested Courses
Course of the Month12 days, 17 hours left to enroll

777 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