Can't create a new dataset from the toolbox.

In the past, on the advice of MVPs, I've created datasets by dragging the
dataset component from the datatab of the toolbox onto the form. The first
time it created dataset1, a dataset that did not exist before.

The second time it created a dataset2.

Today I dragged a dataset on a new form. It only offered current datasets,
not a default of a new dataset. When I typed in tfsNet2.dataset3 and clicked
OK, I got an error message

Visual Studio cannot create an instance of TFSMet2.Dataset3.
Confirm the class name is a valid dataset class.

What happened? Please help.

Dennis

Re: Can't create a new dataset from the toolbox by Cor

Cor
Thu Oct 21 05:06:28 CDT 2004

Dennis,

You can look in your code if a dataset3 exist that is often orphaned.

As well you can open the solution explorer if you see if there already is a
dataset3.xsd which will not be romoved when you delete a previous made
dataset.

Just some ideas

Cor



RE: Can't create a new dataset from the toolbox by polynomial5d

polynomial5d
Thu Oct 21 05:11:01 CDT 2004

I forgot to add that dataset1 and dataset2 do not appear in the designer. I
can't remember how I did this.

Dennis

"Dennis" wrote:

> Can't create a new dataset from the toolbox.
>
> In the past, on the advice of MVPs, I've created datasets by dragging the
> dataset component from the datatab of the toolbox onto the form. The first
> time it created dataset1, a dataset that did not exist before.
>
> The second time it created a dataset2.
>
> Today I dragged a dataset on a new form. It only offered current datasets,
> not a default of a new dataset. When I typed in tfsNet2.dataset3 and clicked
> OK, I got an error message
>
> Visual Studio cannot create an instance of TFSMet2.Dataset3.
> Confirm the class name is a valid dataset class.
>
> What happened? Please help.
>
> Dennis

Re: Can't create a new dataset from the toolbox by polynomial5d

polynomial5d
Thu Oct 21 06:35:05 CDT 2004

hanks Cor,

But I didn't make myself understood. When I dragged the dataset component
for the toolbox originally, the designer offered a name that didn't
previously exist. The first time it offered dataset1, the second time
dataset2.

Now it only offers a combobox of existing datasets, and I don't see anyway
of choosing a different name. Every name I try brings forth the same error
message. If I change the name to fo9rosdflsdf, it'll give me the same
message.

Dennis

"Cor Ligthert" wrote:

> Dennis,
>
> You can look in your code if a dataset3 exist that is often orphaned.
>
> As well you can open the solution explorer if you see if there already is a
> dataset3.xsd which will not be romoved when you delete a previous made
> dataset.
>
> Just some ideas
>
> Cor
>
>
>

Re: Can't create a new dataset from the toolbox by Cor

Cor
Thu Oct 21 07:35:39 CDT 2004

Dennis,

Did you try it with a clean project to see if it is in your project or
another errror?

Cor



Re: Can't create a new dataset from the toolbox by polynomial5d

polynomial5d
Thu Oct 21 08:23:05 CDT 2004

yes, same problem.

thanks.

dennis

"Cor Ligthert" wrote:

> Dennis,
>
> Did you try it with a clean project to see if it is in your project or
> another errror?
>
> Cor
>
>
>

Re: Can't create a new dataset from the toolbox by v-kevy

v-kevy
Thu Oct 21 21:13:19 CDT 2004

Hi Dennis,

First of all, I would like to confirm my understanding of your issue. From
your description, I understand that you need to add a DataSet instance to
the current form. If there is any misunderstanding, please feel free to let
me know.

As far as I know, there are 2 kinds of DataSet we can add from the toolbox,
typed DataSet and untyped DataSet. When trying to add a typed DataSet
instance, the schema must be available in the project. That means we have
to create the DataSet3.xsd file first in Solution Explorer.

I think maybe you have created the DataSet from a DataAdapter. When you
have created a DataAdapter in winform designer, you can right click on that
DataAdapter and select Generate DataSet. It will help you to create the
DataSet xsd file and can generate an instance for that typed DataSet at the
same time.

HTH.

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."


Re: Can't create a new dataset from the toolbox by polynomial5d

polynomial5d
Fri Oct 22 01:07:02 CDT 2004

Hi Kevin,

I want to add a typed dataset. You gave me an example of that once. I
don't remember any instructions for creating the xsd file first. Can you
tell me how to do that?

Thank you.

Dennis

I was trying to create

"Kevin Yu [MSFT]" wrote:

> Hi Dennis,
>
> First of all, I would like to confirm my understanding of your issue. From
> your description, I understand that you need to add a DataSet instance to
> the current form. If there is any misunderstanding, please feel free to let
> me know.
>
> As far as I know, there are 2 kinds of DataSet we can add from the toolbox,
> typed DataSet and untyped DataSet. When trying to add a typed DataSet
> instance, the schema must be available in the project. That means we have
> to create the DataSet3.xsd file first in Solution Explorer.
>
> I think maybe you have created the DataSet from a DataAdapter. When you
> have created a DataAdapter in winform designer, you can right click on that
> DataAdapter and select Generate DataSet. It will help you to create the
> DataSet xsd file and can generate an instance for that typed DataSet at the
> same time.
>
> HTH.
>
> Kevin Yu
> =======
> "This posting is provided "AS IS" with no warranties, and confers no
> rights."
>
>

Re: Can't create a new dataset from the toolbox by v-kevy

v-kevy
Fri Oct 22 02:32:32 CDT 2004

Hi Dennis,

There are 2 ways to achieve that.

1. If you already have a DataAapter created to fill that DataSet, you can
right click the DataAdapter on the designer and select Generate DataSet
from the popup menu. If you check Add this dataset to the designer, not
only the xsd file is generated, the DataSet is also instantiated.

2. If you don't have a DataAdapter created according to the DataSet, you
have to do the following. Right click on the project in the solution
explorer. Select Add/ Add New Item. Add a DataSet. In the DataSet, create
the schema. You can navigate in the Server Explorer and drag drop tables
from SQL servers directly. When the schema is created, go back to the
windows form designer and add DataSet from the toolbox. The created schema
for example, Dataset1 is in the combobox. You can select that and an
instance of DataSet1 is created.

HTH.

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."


Re: Can't create a new dataset from the toolbox by polynomial5d

polynomial5d
Fri Oct 22 03:39:02 CDT 2004

Thanks, Kevin

#2 worked perfectly.

Dennis


"Kevin Yu [MSFT]" wrote:

> Hi Dennis,
>
> There are 2 ways to achieve that.
>
> 1. If you already have a DataAapter created to fill that DataSet, you can
> right click the DataAdapter on the designer and select Generate DataSet
> from the popup menu. If you check Add this dataset to the designer, not
> only the xsd file is generated, the DataSet is also instantiated.
>
> 2. If you don't have a DataAdapter created according to the DataSet, you
> have to do the following. Right click on the project in the solution
> explorer. Select Add/ Add New Item. Add a DataSet. In the DataSet, create
> the schema. You can navigate in the Server Explorer and drag drop tables
> from SQL servers directly. When the schema is created, go back to the
> windows form designer and add DataSet from the toolbox. The created schema
> for example, Dataset1 is in the combobox. You can select that and an
> instance of DataSet1 is created.
>
> HTH.
>
> Kevin Yu
> =======
> "This posting is provided "AS IS" with no warranties, and confers no
> rights."
>
>

Re: Can't create a new dataset from the toolbox by v-kevy

v-kevy
Sat Oct 23 03:49:42 CDT 2004

You're welcome, Dennis.

Thanks for sharing your experience with all the people here. If you have
any questions, please feel free to post them in the community.

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."