views:

731

answers:

7

Hi- I moved a typed dataset from one project to an ASP Web Application project. I put the typed dataset into one of the existing directories as it was in the App_Code directory of the previous site but don't see the option to create that asp.net folder in this project.

Now, when I try to instantiate the typed dataset, the compiler says 'The type or namespace name '' could not be found (are you missing a using directive or an assembly reference?)'.

Thoughts?

A: 

You have included the "using namespace" statement in the new code?

Kb
Yes. When I did that and the compiler says 'Type or namespace name not be found <namespace>'. I referenced newly imported classfiles from another namespace just fine. The typed dataset is the only file so far it it's namespace.
asp316
Confirm if there is namespace in a .cs file generated from .xsd (right-click on .xsd > "View Code"). There is a "Custom Tool Namespace" you can specify in XSD file properties - check out if assigning it helps.
DK
+3  A: 

You may need to re-gen the DataSet. When you move the .xsd, you've only moved the xml layout of the DataSet.

Delete any generated code file, open the xsd, move something, and then save it. The save operation calls the generator. Or you can right-click on the .xsd file and call the generator directly.

Mark A Johnson
Just to clarify - this does work. You can expand the XSD in the Solution Explorer, and simply delete the Designer.vb file. Then open your dataset (XSD file) and drag the dataset a little bit. Then Save. I couldn't see what it actually changes in the Designer file.
ZhanZhuang
A: 

When I use My error message says:

Error 3 Expected class, delegate, enum, interface, or struct O:\RSS_Reader_C\BookService\App_Code\BookService.cs 55 12 O:\RSS_Reader_C\BookService\

I am having the same issue.
Shimmy
A: 

Make sure the compiler knows it's a dataset and not just an Xml file. Select the DataSet.xsd in Solution Explorer, then in the Project window ensure that "Custom Tool" is set to MSDataSetGenerator.

After that, instead of guessing, open up the dll file in Reflector and look for your DataSet class. Make sure it's in the namespace you think it is.

tnyfst
A: 

Where is this dataset.xsd? I don't see it listed in the solution!

A: 

I moved my web site to a Web Application Project and experienced the same issues. I took the approach mentioned in the first answer and was able to get the project to compile eventually. I would like to add a little more detail to the first answer.

To be explicit: I first deleted all of the files associated with the xsd file except for the xsd file itself (the xss, xsc, cs, ...). I then right-clicked on the xsd file, selecting "View Designer" and then "View Code", and then "Run Custom Tool". All of the files were re-gened and the references compiled.

A: 

it's a Vb.net using windows forms

harinath
its not a Answer its a Question
harinath