471,888 Members | 2,402 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,888 software developers and data experts.

2.0 dataset issues - again

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
Jan 4 '06 #1
8 4968
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" <Ga******@newsgroups.nospam>
| 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: <O$**************@TK2MSFTNGP10.phx.gbl>
| Newsgroups: microsoft.public.dotnet.framework.aspnet
| NNTP-Posting-Host: 216.244.8.41
| Path: TK2MSFTNGXA02.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFT NGP10.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
|
|
|

Jan 4 '06 #2
On Tue, 3 Jan 2006 17:48:54 -0800, "GaryDean"
<Ga******@newsgroups.nospam> wrote:
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
Jan 5 '06 #3
On Wed, 04 Jan 2006 20:48:23 -0600, Otis Mukinfus
<ph***@emailaddress.com> wrote:

Aw shoot fellas, Take DISTINCT out of the query and it will work...
On Tue, 3 Jan 2006 17:48:54 -0800, "GaryDean"
<Ga******@newsgroups.nospam> wrote:
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
Jan 5 '06 #4
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" <ph***@emailaddress.com> wrote in message
news:gt********************************@4ax.com...
On Tue, 3 Jan 2006 17:48:54 -0800, "GaryDean"
<Ga******@newsgroups.nospam> wrote:
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

Jan 7 '06 #5
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" <Ga******@newsgroups.nospam>
| References: <O$**************@TK2MSFTNGP10.phx.gbl>
<gt********************************@4ax.com>
| 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: <uQ*************@TK2MSFTNGP10.phx.gbl>
| Newsgroups: microsoft.public.dotnet.framework.aspnet
| NNTP-Posting-Host: 216.244.8.41
| Path: TK2MSFTNGXA02.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFT NGP10.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
| "Otis Mukinfus" <ph***@emailaddress.com> wrote in message
| news:gt********************************@4ax.com...
| > On Tue, 3 Jan 2006 17:48:54 -0800, "GaryDean"
| > <Ga******@newsgroups.nospam> wrote:
| >
| >>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
|
|
|

Jan 9 '06 #6
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?
Steven Cheng[MSFT] wrote:
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" <Ga******@newsgroups.nospam>
| References: <O$**************@TK2MSFTNGP10.phx.gbl>
<gt********************************@4ax.com>
| 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: <uQ*************@TK2MSFTNGP10.phx.gbl>
| Newsgroups: microsoft.public.dotnet.framework.aspnet
| NNTP-Posting-Host: 216.244.8.41
| Path: TK2MSFTNGXA02.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFT NGP10.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
| "Otis Mukinfus" <ph***@emailaddress.com> wrote in message
| news:gt********************************@4ax.com...
| > On Tue, 3 Jan 2006 17:48:54 -0800, "GaryDean"
| > <Ga******@newsgroups.nospam> wrote:
| >
| >>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
|
|
|


Feb 1 '06 #7
I am having the EXACT same problem, with no solution in site. Have you
figured this one out?

Thanks,
Steve

Feb 13 '06 #8
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/ProductFeedback/viewFeedback.aspx?feedbackid=9376ccd0-6f81-4660-9053-4a06696264f7"
Hope that helps. -ricteel

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

Thanks,
Steve

Mar 27 '06 #9

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

10 posts views Thread by jaYPee | last post: by
22 posts views Thread by Arne | last post: by
2 posts views Thread by Nick Hustak | last post: by
13 posts views Thread by Maxwell2006 | last post: by
7 posts views Thread by SteveT | last post: by
8 posts views Thread by Matt MacDonald | last post: by
reply views Thread by YellowAndGreen | last post: by
reply views Thread by zermasroor | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.