2.0 dataset issues - again

G

GaryDean

In an 2.0 asp app I used vs.net 2005 to create a TableAdapter:Dataset in my
App_code directory. I also created a new vb class in that same directory.
I have two issues:

1.
I notice that there are errors in the xml code for the dataset...
<TableAdapter BaseClass="system.ComponentModel.Component"
DataAccessorModifier...
the DataAccessorModifier is underlined as an error - if I hover over it, it
says that attribute is not declared. GenerateShortcommands,
ParameterPrefix - same thing - attirubte not declared.

Also parameter AllowDBNull is underlined - also saying that the attribute is
not declared.
Why do these errors exist?

2.
Assuming I can get this .xsd generated correctly, how can I get reference to
the tableAdapter and it's fill method in my class so I can use it. I have
tried everything I can think of to reference it but nothing seems to work.
Unlike a 2003 dataset it doesn't seem to be in a namespace so I can't say
myTA = new myproject.tableadapter.
 
S

Steven Cheng[MSFT]

Hi Gary,

Regarding on the two questions in this thread, I've posted some suggestion
(on using the ObjectDataSource to reference TableAdatper in asp.net 2.0
page at design-time ) in your other two threads. You can have a look there.

As for the first question on XML error, are you editing the TypedDataSet's
generated xsd file in Xml editor? Generally those autogenerated content do
not need to be directly edited through xml editor and the xml errors you
met is due to the XSD validation of the XML Editor... XmlEditor will
validate the xml document it load if the document refer to some xml schema
(xsd). And the TableAdapter/dataset's xsd file will refer to some buildin
schemas and VS IDE's install directory will contains a copy of these schema
files for such validation. However, some attributes are not included in
those VS IDE's xsd file copies(since some one are added later and hasn't
been synchronized into the VS IDE's schema copy), then xml editor will
report error that can not find the certain attribute declaration in xsd
file.... You can directly modify the schema files in VS 2005's program
folder so as to meet the validation requirement (most of them are under the
C:\Program Files\Microsoft Visual Studio 8\Xml\Schemas dir), but we don't
recommend this... Also, this xsd validation error is just specific to xml
editor , it won't affect the runtime compilation or code generating for the
TAbleAdatper/DataSet, you can correct use them regardless of these xml
validation errors...

Thanks,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)


--------------------
| From: "GaryDean" <[email protected]>
| Subject: 2.0 dataset issues - again
| Date: Tue, 3 Jan 2006 17:48:54 -0800
| Lines: 28
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
| X-RFC2646: Format=Flowed; Original
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
| Message-ID: <[email protected]>
| Newsgroups: microsoft.public.dotnet.framework.aspnet
| NNTP-Posting-Host: 216.244.8.41
| Path: TK2MSFTNGXA02.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP10.phx.gbl
| Xref: TK2MSFTNGXA02.phx.gbl
microsoft.public.dotnet.framework.aspnet:368422
| X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
|
| In an 2.0 asp app I used vs.net 2005 to create a TableAdapter:Dataset in
my
| App_code directory. I also created a new vb class in that same
directory.
| I have two issues:
|
| 1.
| I notice that there are errors in the xml code for the dataset...
| <TableAdapter BaseClass="system.ComponentModel.Component"
| DataAccessorModifier...
| the DataAccessorModifier is underlined as an error - if I hover over it,
it
| says that attribute is not declared. GenerateShortcommands,
| ParameterPrefix - same thing - attirubte not declared.
|
| Also parameter AllowDBNull is underlined - also saying that the attribute
is
| not declared.
| Why do these errors exist?
|
| 2.
| Assuming I can get this .xsd generated correctly, how can I get reference
to
| the tableAdapter and it's fill method in my class so I can use it. I
have
| tried everything I can think of to reference it but nothing seems to
work.
| Unlike a 2003 dataset it doesn't seem to be in a namespace so I can't say
| myTA = new myproject.tableadapter.
|
| --
| Regards,
| Gary Blakely
|
|
|
 
O

Otis Mukinfus

In an 2.0 asp app I used vs.net 2005 to create a TableAdapter:Dataset in my
App_code directory. I also created a new vb class in that same directory.
I have two issues:

1.
I notice that there are errors in the xml code for the dataset...
<TableAdapter BaseClass="system.ComponentModel.Component"
DataAccessorModifier...
the DataAccessorModifier is underlined as an error - if I hover over it, it
says that attribute is not declared. GenerateShortcommands,
ParameterPrefix - same thing - attirubte not declared.

Also parameter AllowDBNull is underlined - also saying that the attribute is
not declared.
Why do these errors exist?

2.
Assuming I can get this .xsd generated correctly, how can I get reference to
the tableAdapter and it's fill method in my class so I can use it. I have
tried everything I can think of to reference it but nothing seems to work.
Unlike a 2003 dataset it doesn't seem to be in a namespace so I can't say
myTA = new myproject.tableadapter.

When you get the TableAdapter.DataSet generated look in the dataset
code (YourDataSet.Designer.cs). You will find a namespace in there
named YourDataSetTableAdapters. a using statement to your code
referring to that namespace. Here is an example:

using System;
using System.Collections.Generic;
using System.Text;
using System.Data;
using TestConsole.N5GEDataSetTableAdapters;

namespace TestConsole
{
class Program
{
static void Main(string[] args)
{
USCitiesTableAdapter ta = new USCitiesTableAdapter();
N5GEDataSet ds = new N5GEDataSet();

ta.Fill(ds.USCities);

DataRow [] cities =
ds.USCities.select("Distinct city = 'arlington'", "City, state
ASC");
}
}
}


Otis Mukinfus
http://www.otismukinfus.com
http://www.tomchilders.com
 
O

Otis Mukinfus

On Wed, 04 Jan 2006 20:48:23 -0600, Otis Mukinfus

Aw shoot fellas, Take DISTINCT out of the query and it will work...
In an 2.0 asp app I used vs.net 2005 to create a TableAdapter:Dataset in my
App_code directory. I also created a new vb class in that same directory.
I have two issues:

1.
I notice that there are errors in the xml code for the dataset...
<TableAdapter BaseClass="system.ComponentModel.Component"
DataAccessorModifier...
the DataAccessorModifier is underlined as an error - if I hover over it, it
says that attribute is not declared. GenerateShortcommands,
ParameterPrefix - same thing - attirubte not declared.

Also parameter AllowDBNull is underlined - also saying that the attribute is
not declared.
Why do these errors exist?

2.
Assuming I can get this .xsd generated correctly, how can I get reference to
the tableAdapter and it's fill method in my class so I can use it. I have
tried everything I can think of to reference it but nothing seems to work.
Unlike a 2003 dataset it doesn't seem to be in a namespace so I can't say
myTA = new myproject.tableadapter.

When you get the TableAdapter.DataSet generated look in the dataset
code (YourDataSet.Designer.cs). You will find a namespace in there
named YourDataSetTableAdapters. a using statement to your code
referring to that namespace. Here is an example:

using System;
using System.Collections.Generic;
using System.Text;
using System.Data;
using TestConsole.N5GEDataSetTableAdapters;

namespace TestConsole
{
class Program
{
static void Main(string[] args)
{
USCitiesTableAdapter ta = new USCitiesTableAdapter();
N5GEDataSet ds = new N5GEDataSet();

ta.Fill(ds.USCities);

DataRow [] cities =
ds.USCities.select("Distinct city = 'arlington'", "City, state
ASC");
}
}
}


Otis Mukinfus
http://www.otismukinfus.com
http://www.tomchilders.com

Otis Mukinfus
http://www.otismukinfus.com
http://www.tomchilders.com
 
G

GaryDean

All I have after creating the tableadapter:dataset is a .xsd file and a .xss
file. I know that in Forms apps I could double-click the file node of the
..xsd and a mydatasetDesigner.vb file would be generated but this does not
work in asp apps.

So, I have no designer .vb file (.cs in your case)


Regards,
Gary Blakely
Otis Mukinfus said:
In an 2.0 asp app I used vs.net 2005 to create a TableAdapter:Dataset in
my
App_code directory. I also created a new vb class in that same directory.
I have two issues:

1.
I notice that there are errors in the xml code for the dataset...
<TableAdapter BaseClass="system.ComponentModel.Component"
DataAccessorModifier...
the DataAccessorModifier is underlined as an error - if I hover over it,
it
says that attribute is not declared. GenerateShortcommands,
ParameterPrefix - same thing - attirubte not declared.

Also parameter AllowDBNull is underlined - also saying that the attribute
is
not declared.
Why do these errors exist?

2.
Assuming I can get this .xsd generated correctly, how can I get reference
to
the tableAdapter and it's fill method in my class so I can use it. I have
tried everything I can think of to reference it but nothing seems to work.
Unlike a 2003 dataset it doesn't seem to be in a namespace so I can't say
myTA = new myproject.tableadapter.

When you get the TableAdapter.DataSet generated look in the dataset
code (YourDataSet.Designer.cs). You will find a namespace in there
named YourDataSetTableAdapters. a using statement to your code
referring to that namespace. Here is an example:

using System;
using System.Collections.Generic;
using System.Text;
using System.Data;
using TestConsole.N5GEDataSetTableAdapters;

namespace TestConsole
{
class Program
{
static void Main(string[] args)
{
USCitiesTableAdapter ta = new USCitiesTableAdapter();
N5GEDataSet ds = new N5GEDataSet();

ta.Fill(ds.USCities);

DataRow [] cities =
ds.USCities.select("Distinct city = 'arlington'", "City, state
ASC");
}
}
}


Otis Mukinfus
http://www.otismukinfus.com
http://www.tomchilders.com
 
S

Steven Cheng[MSFT]

Hi Gary,

ASP.NET 2.0 web app in vs 2005 put source code file, and xsd files into
App_Code folder so as to make them dynamic compiled. So you will not find
the .designer.cs(vb) file. The class is purely generated and compiled at
runtime. And for the DataSet's TableAdapters they're also dynamically
compiled and genrated (when we hit "save" or "save all", the dynamic
compilation take place...). And to get the TableAdapter classes' namespace
name and class name, just use objectDataSource's configuration wizard
(through smartTag), and it'll help list all the current avaiable(compiled)
components which include the TableAdapters, we don't need to guess the
name...

Also, if you want develop your DataSet/TableAdatper using the style like in
winform application, you can consider create a class library project and
create the DataSet/TAbleAdapter there...

Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
--------------------
| From: "GaryDean" <[email protected]>
| References: <[email protected]>
<[email protected]>
| Subject: Re: 2.0 dataset issues - again
| Date: Fri, 6 Jan 2006 17:27:08 -0800
| Lines: 77
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
| X-RFC2646: Format=Flowed; Original
| Message-ID: <[email protected]>
| Newsgroups: microsoft.public.dotnet.framework.aspnet
| NNTP-Posting-Host: 216.244.8.41
| Path: TK2MSFTNGXA02.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP10.phx.gbl
| Xref: TK2MSFTNGXA02.phx.gbl
microsoft.public.dotnet.framework.aspnet:369160
| X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
|
| All I have after creating the tableadapter:dataset is a .xsd file and a
..xss
| file. I know that in Forms apps I could double-click the file node of
the
| .xsd and a mydatasetDesigner.vb file would be generated but this does not
| work in asp apps.
|
| So, I have no designer .vb file (.cs in your case)
|
|
| Regards,
| Gary Blakely
| | > On Tue, 3 Jan 2006 17:48:54 -0800, "GaryDean"
| >
| >>In an 2.0 asp app I used vs.net 2005 to create a TableAdapter:Dataset
in
| >>my
| >>App_code directory. I also created a new vb class in that same
directory.
| >>I have two issues:
| >>
| >>1.
| >>I notice that there are errors in the xml code for the dataset...
| >><TableAdapter BaseClass="system.ComponentModel.Component"
| >>DataAccessorModifier...
| >>the DataAccessorModifier is underlined as an error - if I hover over
it,
| >>it
| >>says that attribute is not declared. GenerateShortcommands,
| >>ParameterPrefix - same thing - attirubte not declared.
| >>
| >>Also parameter AllowDBNull is underlined - also saying that the
attribute
| >>is
| >>not declared.
| >>Why do these errors exist?
| >>
| >>2.
| >>Assuming I can get this .xsd generated correctly, how can I get
reference
| >>to
| >>the tableAdapter and it's fill method in my class so I can use it. I
have
| >>tried everything I can think of to reference it but nothing seems to
work.
| >>Unlike a 2003 dataset it doesn't seem to be in a namespace so I can't
say
| >>myTA = new myproject.tableadapter.
| >
| > When you get the TableAdapter.DataSet generated look in the dataset
| > code (YourDataSet.Designer.cs). You will find a namespace in there
| > named YourDataSetTableAdapters. a using statement to your code
| > referring to that namespace. Here is an example:
| >
| > using System;
| > using System.Collections.Generic;
| > using System.Text;
| > using System.Data;
| > using TestConsole.N5GEDataSetTableAdapters;
| >
| > namespace TestConsole
| > {
| > class Program
| > {
| > static void Main(string[] args)
| > {
| > USCitiesTableAdapter ta = new USCitiesTableAdapter();
| > N5GEDataSet ds = new N5GEDataSet();
| >
| > ta.Fill(ds.USCities);
| >
| > DataRow [] cities =
| > ds.USCities.select("Distinct city = 'arlington'", "City, state
| > ASC");
| > }
| > }
| > }
| >
| >
| > Otis Mukinfus
| > http://www.otismukinfus.com
| > http://www.tomchilders.com
|
|
|
 
D

dave.dolan

OK guys, this still doesn't solve anything for me, and you also don't
seem to have solved it for the poster, just basically showed him how to
run the designer with a static code file.... If I do it in a library,
or in the App_Code and let it autogenerate, I have the same problem as
the thread starter.

I actually get the following error from the code generator: Unable to
convert input xml file content to DataSet. 0 is not a valid value for
Int32. Input string was not in a correct format.

Since when is 0 not a valid value for Int32? er... All I did was drag a
table from the server explorer right onto the dataset designer.


Upon investigating further, I see in the XSD file (I'm only looking I
saw the post that says i shouldn't have to edit it.) I see that the
same Attributes are not declared. I do get a .cs file in the library
mode, but it's blank. Nothing in it except an emtpy Partial class
definition.

One thing that I do have to say is that I'm using SQL 2000 as the db,
and VS 2005 as the development tool. Could there be something here I'm
missing?

Help?

Hi Gary,

ASP.NET 2.0 web app in vs 2005 put source code file, and xsd files into
App_Code folder so as to make them dynamic compiled. So you will not find
the .designer.cs(vb) file. The class is purely generated and compiled at
runtime. And for the DataSet's TableAdapters they're also dynamically
compiled and genrated (when we hit "save" or "save all", the dynamic
compilation take place...). And to get the TableAdapter classes' namespace
name and class name, just use objectDataSource's configuration wizard
(through smartTag), and it'll help list all the current avaiable(compiled)
components which include the TableAdapters, we don't need to guess the
name...

Also, if you want develop your DataSet/TableAdatper using the style like in
winform application, you can consider create a class library project and
create the DataSet/TAbleAdapter there...

Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
--------------------
| From: "GaryDean" <[email protected]>
| References: <[email protected]>
<[email protected]>
| Subject: Re: 2.0 dataset issues - again
| Date: Fri, 6 Jan 2006 17:27:08 -0800
| Lines: 77
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
| X-RFC2646: Format=Flowed; Original
| Message-ID: <[email protected]>
| Newsgroups: microsoft.public.dotnet.framework.aspnet
| NNTP-Posting-Host: 216.244.8.41
| Path: TK2MSFTNGXA02.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP10.phx.gbl
| Xref: TK2MSFTNGXA02.phx.gbl
microsoft.public.dotnet.framework.aspnet:369160
| X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
|
| All I have after creating the tableadapter:dataset is a .xsd file and a
.xss
| file. I know that in Forms apps I could double-click the file node of
the
| .xsd and a mydatasetDesigner.vb file would be generated but this does not
| work in asp apps.
|
| So, I have no designer .vb file (.cs in your case)
|
|
| Regards,
| Gary Blakely
| | > On Tue, 3 Jan 2006 17:48:54 -0800, "GaryDean"
| >
| >>In an 2.0 asp app I used vs.net 2005 to create a TableAdapter:Dataset
in
| >>my
| >>App_code directory. I also created a new vb class in that same
directory.
| >>I have two issues:
| >>
| >>1.
| >>I notice that there are errors in the xml code for the dataset...
| >><TableAdapter BaseClass="system.ComponentModel.Component"
| >>DataAccessorModifier...
| >>the DataAccessorModifier is underlined as an error - if I hover over
it,
| >>it
| >>says that attribute is not declared. GenerateShortcommands,
| >>ParameterPrefix - same thing - attirubte not declared.
| >>
| >>Also parameter AllowDBNull is underlined - also saying that the
attribute
| >>is
| >>not declared.
| >>Why do these errors exist?
| >>
| >>2.
| >>Assuming I can get this .xsd generated correctly, how can I get
reference
| >>to
| >>the tableAdapter and it's fill method in my class so I can use it. I
have
| >>tried everything I can think of to reference it but nothing seems to
work.
| >>Unlike a 2003 dataset it doesn't seem to be in a namespace so I can't
say
| >>myTA = new myproject.tableadapter.
| >
| > When you get the TableAdapter.DataSet generated look in the dataset
| > code (YourDataSet.Designer.cs). You will find a namespace in there
| > named YourDataSetTableAdapters. a using statement to your code
| > referring to that namespace. Here is an example:
| >
| > using System;
| > using System.Collections.Generic;
| > using System.Text;
| > using System.Data;
| > using TestConsole.N5GEDataSetTableAdapters;
| >
| > namespace TestConsole
| > {
| > class Program
| > {
| > static void Main(string[] args)
| > {
| > USCitiesTableAdapter ta = new USCitiesTableAdapter();
| > N5GEDataSet ds = new N5GEDataSet();
| >
| > ta.Fill(ds.USCities);
| >
| > DataRow [] cities =
| > ds.USCities.select("Distinct city = 'arlington'", "City, state
| > ASC");
| > }
| > }
| > }
| >
| >
| > Otis Mukinfus
| > http://www.otismukinfus.com
| > http://www.tomchilders.com
|
|
|
 
S

SteveO

I am having the EXACT same problem, with no solution in site. Have you
figured this one out?

Thanks,
Steve
 
G

Guest

Hello All:

I too have been having this exact problem. When i try to compile ANY
project with an XSD dataset in it, I get the error: "0 is not a valid
value for Int32." I submitted a case with Microsoft and they provided
this as a fix for me:

1. Backup your computer's registry settings by doing an export on the
HKEY_CURRENT_USER branch (in case you need to restore them later).

2. Check the current setting for HKEY_CURRENT_USER | Control Panel |
International | sPositiveSign. It is probably blank.

3. Change that setting to 2 double quotes (""). Probably anything
would work in that setting as long as it is not zero. But they told me
to use the double quotes, so I did (I can be somewhat of a mindless
slave when I am desparate).

Here is the explanation I received from Microsoft:
"This issue is due to corruption of a registry key's value that deals
with globalization settings. The registry key "sPositiveSign" under
HKEY_CURRENT_USER\Control Panel\International should be blank for this
to work correctly. If this is set to 0 the above exception will occur.
Change this value to " " in the registry key to correct this exception.
Note that whenever the value that is parsed is the same as the value
for the 'sPositiveSign' item this exception is thrown.

Normally this error happens only if there is an entry "0" for the
sPositiveSign registry settings. If any program modified the regional
settings to a bad value also results this issue. Please have a look at
this article

Bug Details: int.Parse can fail unexpected if user's regional settings
are corrupt

http://lab.msdn.microsoft.com/Produ...edbackid=9376ccd0-6f81-4660-9053-4a06696264f7"


Hope that helps. -ricteel
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,780
Messages
2,569,608
Members
45,252
Latest member
MeredithPl

Latest Threads

Top