Can't directly dim an instance of a tableadapter
I'm creating a sample project much smaller than my whole project to isolate some remaining issues. Naturally I'm copying a great deal of code.
However, there have been several anomalies.
In my regular project the statement
Dim cdt As New ConceptsTableAdapter is accepted.
However, in the sample project I am preparing, the same statement gives me the message Type 'ConceptsTableAdapter' is not defined.
Instead I have to use the construction
Dim cdt As New ConceptsSampleDataSetTableAdapters.ConceptsTableAdapter
Even ConceptsSampleDataSet.ConceptsTableAdapter gives the type not defined message.
In both cases I'm using vs2005beta2, on the same computer. In fact on both computers the same thing happens.
Can somebody tell me why
dennist

Can't directly dim an instance of a tableadapter 2005
esun
I did create the concepts table aater is the new project..
dennist
Sorry for the bad typing but I'm 100 % disabled from a terrorist attack.
Rices
Hi,
Have you tried resolving the namespaces Maybe the namespace in which your TableAdapter is defined is not the same on which you would try to dim it...
BTW Ther isn't a base type called TableAdapter. Table Adapters are being derived in the System.ComponentModel.Component class.
Here's a related thread http://forums.microsoft.com/msdn/ShowPost.aspx PostID=6065
cheers,
Paul June A. Domag
Lázaro
Hi,
It looks like the object is contained in a class. If that's the case, then you'll have no choice but to specify the class in dimming it. well you can always check the generated code and see what really goes on there...
cheers,
Paul June A. Domag
ClaraBM
Your original project has a class, component, or DataAdapter that is named ConceptsTableAdapter...so the line 'Dim cdt As New ConceptsTableAdapter' creates a new instance of the object.
When you cut and pasted the code into a new project it lost the reference to ConceptsTableAdapter...you need to copy and past that object to your new project also or create a reference to the project in which it does exist.
emau_son
However, that still doesn't tell me why I can't directly dim x as new conceptstableadapter.
dennist
golferdrums
Thanks for the suggestion.
Even in the case I can directly dim ConceptsTableAdapter, it doesn't appear after the . Only dshasbaraTableAdapters.
Dim x As Hasbara.dsHasbaraTableAdapters.ConceptsTableAdapter Dim y As ConceptsTableAdapter
dennist
iceshadow625
Hi,
Just be sure that you are just using one namespace. Coz if you have declared your TableAdapter in a seperate .cs and used a different namespace you'll have to include the namespace in the using directives to ba able to dim objects in your project.
eg.
namespace sample1 {
class ConceptsAdapter {
}
}
// other file
using sample1;
namespace sample2 {
class main {
static void main() {
Dim s As New ConceptsAdapter
}
}
}
cheers,
Paul June A. Domag
ilia7
In the original there is no class or DataAdapter named ConceptsTableAdapter. However, in both the original and the sample there is the same component. If I open ConceptsSampleDataSet.xsd, there sitting in the middle of the diagram is the typical table box.
The top of the box is Concepts, with the four columns.
The bottom of the box is ConceptsTableAdapter, with the Fill,GetData, and three other queries I created.
So my bet is that there's another reason.
dennist
mnowinski
The material in the related thread is hard to digest because there aren't any books out (at least in Israel) based on the 2.0 framework, beta2.
As far as this thread, I'm not sure what you mean by namespaces. Isn't there only one namespace I have to be concerned with - 'Concepts' , the name of the solution
dennist
Jthorpdenver
Hi,
You could check if your tableadapter is a member of your namespace by typing your current namespace and press period. The intellisense would display all the classes belonging to the namespace...
Dim x As myNamespace.[check if the conceptstableadapter class is present in the dropdown box]
If its present then I think there would be no problem "Dimming" it in your app... But if its present and still you can't declare it, you can provide steps on reproducing it. So that we can investigate the matter more closely...
cheers,
Paul June A. Domag