473,320 Members | 1,955 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

2.0 DataSources vs. TableAdapter/Datasets

We have been noticing that questions on vs.2005/2.0 don't appear to get much
in answers so I'm reposting some questions posted by some of the programmers
here in our organization that never got answered...

There are articles on the new TableAdapters where it says that a key new
advantage is that a single TableAdapter, which can have multiple queries,
can be used on multiple forms. Now that was in an article on using
TableAdapters with Forms Apps. There is a DataSource window that stores
common datasources for the whole project (accessed via the Data menu item).

Now, back to ASP apps - there is no Data on the menu, no datasource window,
and it looks like TableAdapters need to be generated from a DataSource
dropped on a page. Does this mean that aspx pages won't be able to share
TableAdapters?

Also, in Form apps the IDE guids us to create the new 2.0 .XSD datasets that
have TableAdapters where the ASP IDE guids us to create DataSources that
don't create .XSDs with TableAdapters. Why the difference?
--
Regards,
Gary Blakely
Dec 31 '05 #1
9 2873
Hi Gary,

Welcome.
As for the TableAdapter's different design mode and behavior in .net 2.0
winform app and asp.net application ,here are some of my understanding and
suggestions:

For the different design-time support and behavior on using TableAdpater
components in winform application and asp.net application, it is due to the
different underlying application nature and programming model. Winform
application is desktop app where all the class instances and componets live
in the application's memorty space as long as the application keep alive...
While for asp.net application, it is request/response based, asp.net page
instance only live when a request arrive server and being processed, after
request finished, the page object will disposed(also, mulitple page
instances won't have relations to each other.... ) , so we should not use
the same programming model as winform app.

For sharing component instance or class objects in asp.net application, we
can use the following means:

1. Create the shared component instance and store it in a global wide
storage, e.g the ApplicationState or Application Cache is the reasonable
place for storing such component....

2. Also, if your applcation always running in a single appdomain, you can
consider using a certain class's public static member property to hold such
shared data or resources so that all the pages requests can reference those
shared objects....

In addition, ASP.NET appliation in VS.NET can help us create typed dataset
and a TableAdapter through design surface, however, as I mentioned, due to
the different programming model, ASP.NET will have limited support on using
TableAdpater as winform application at design-time.... but since
TableAdapter has encapsulated most code, we can just declare certain
vartiables and create the instance to use them.....

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 DataSources vs. TableAdapter/Datasets
| Date: Sat, 31 Dec 2005 14:29:31 -0800
| Lines: 25
| 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: <ep*************@TK2MSFTNGP09.phx.gbl>
| Newsgroups: microsoft.public.dotnet.framework.aspnet
| NNTP-Posting-Host: user-vcaur7q.dsl.mindspring.com 216.175.108.250
| Path: TK2MSFTNGXA02.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFT NGP09.phx.gbl
| Xref: TK2MSFTNGXA02.phx.gbl
microsoft.public.dotnet.framework.aspnet:367882
| X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
|
| We have been noticing that questions on vs.2005/2.0 don't appear to get
much
| in answers so I'm reposting some questions posted by some of the
programmers
| here in our organization that never got answered...
|
| There are articles on the new TableAdapters where it says that a key new
| advantage is that a single TableAdapter, which can have multiple queries,
| can be used on multiple forms. Now that was in an article on using
| TableAdapters with Forms Apps. There is a DataSource window that stores
| common datasources for the whole project (accessed via the Data menu
item).
|
| Now, back to ASP apps - there is no Data on the menu, no datasource
window,
| and it looks like TableAdapters need to be generated from a DataSource
| dropped on a page. Does this mean that aspx pages won't be able to share
| TableAdapters?
|
| Also, in Form apps the IDE guids us to create the new 2.0 .XSD datasets
that
| have TableAdapters where the ASP IDE guids us to create DataSources that
| don't create .XSDs with TableAdapters. Why the difference?
|
|
| --
| Regards,
| Gary Blakely
|
|
|

Jan 3 '06 #2
Steven,
Please tell me if this is correct...

I can create a .xsd and TableAdapter for an ASP app in design time. However
vs.net 2005 does not allow me to connect that .xsd to my GridView at design
time (as did vs 2003 allowed me to connect a .xsd to my DataGrid). So
because of this weakness I should do the following.....

Create a .xsd in my App_Code folder. Create a class in my App_Code folder
that returns this dataset. Call this class from my aspx pages.

Is this the best practice???

now, my rant....
It seems like vs2005 has taken us backwords. If we follow the MSDN articles
it has us creating DataSources for our gridviews that puts SQL in our ASPX
pages (and that is not acceptable). vs2005 has also taken away our ability
to bind to datasets at design time - WHY? do I misunderstand?

--
Regards,
Gary Blakely
"Steven Cheng[MSFT]" <st*****@online.microsoft.com> wrote in message
news:PE**************@TK2MSFTNGXA02.phx.gbl...
Hi Gary,

Welcome.
As for the TableAdapter's different design mode and behavior in .net 2.0
winform app and asp.net application ,here are some of my understanding and
suggestions:

For the different design-time support and behavior on using TableAdpater
components in winform application and asp.net application, it is due to
the
different underlying application nature and programming model. Winform
application is desktop app where all the class instances and componets
live
in the application's memorty space as long as the application keep
alive...
While for asp.net application, it is request/response based, asp.net page
instance only live when a request arrive server and being processed, after
request finished, the page object will disposed(also, mulitple page
instances won't have relations to each other.... ) , so we should not use
the same programming model as winform app.

For sharing component instance or class objects in asp.net application, we
can use the following means:

1. Create the shared component instance and store it in a global wide
storage, e.g the ApplicationState or Application Cache is the reasonable
place for storing such component....

2. Also, if your applcation always running in a single appdomain, you can
consider using a certain class's public static member property to hold
such
shared data or resources so that all the pages requests can reference
those
shared objects....

In addition, ASP.NET appliation in VS.NET can help us create typed
dataset
and a TableAdapter through design surface, however, as I mentioned, due to
the different programming model, ASP.NET will have limited support on
using
TableAdpater as winform application at design-time.... but since
TableAdapter has encapsulated most code, we can just declare certain
vartiables and create the instance to use them.....

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 DataSources vs. TableAdapter/Datasets
| Date: Sat, 31 Dec 2005 14:29:31 -0800
| Lines: 25
| 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: <ep*************@TK2MSFTNGP09.phx.gbl>
| Newsgroups: microsoft.public.dotnet.framework.aspnet
| NNTP-Posting-Host: user-vcaur7q.dsl.mindspring.com 216.175.108.250
| Path: TK2MSFTNGXA02.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFT NGP09.phx.gbl
| Xref: TK2MSFTNGXA02.phx.gbl
microsoft.public.dotnet.framework.aspnet:367882
| X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
|
| We have been noticing that questions on vs.2005/2.0 don't appear to get
much
| in answers so I'm reposting some questions posted by some of the
programmers
| here in our organization that never got answered...
|
| There are articles on the new TableAdapters where it says that a key new
| advantage is that a single TableAdapter, which can have multiple
queries,
| can be used on multiple forms. Now that was in an article on using
| TableAdapters with Forms Apps. There is a DataSource window that stores
| common datasources for the whole project (accessed via the Data menu
item).
|
| Now, back to ASP apps - there is no Data on the menu, no datasource
window,
| and it looks like TableAdapters need to be generated from a DataSource
| dropped on a page. Does this mean that aspx pages won't be able to
share
| TableAdapters?
|
| Also, in Form apps the IDE guids us to create the new 2.0 .XSD datasets
that
| have TableAdapters where the ASP IDE guids us to create DataSources that
| don't create .XSDs with TableAdapters. Why the difference?
|
|
| --
| Regards,
| Gary Blakely
|
|
|

Jan 3 '06 #3
Thanks for your response Gary,

My answers in line:

I can create a .xsd and TableAdapter for an ASP app in design time.
However
vs.net 2005 does not allow me to connect that .xsd to my GridView at design
time (as did vs 2003 allowed me to connect a .xsd to my DataGrid). So
because of this weakness I should do the following.....

Create a .xsd in my App_Code folder. Create a class in my App_Code folder
that returns this dataset. Call this class from my aspx pages.

Is this the best practice???
=============================================
Of course we can connect the created TableAdapter/ typed Dataset to the
DataBound control at design-time, just use the ObjectDatasource control,
and the steps to do this is:

i) create the DataSet/TableAdatper pairs through wizard....
ii)drag a ObjectDataSource control onto the page want to use that
TableAdapter/DataSet to retrieve data....
iii) configure the ObjectDataSource control to use the TableAdapter as the
component class
iv) connect the databoundcontrol(gridview, detailsview...) to the
objectdatasource...

Here is the quickstart example which contains bind a tableadapter/dataset
to asp.net databound control at design-time...:

#ObjectDataSource
http://www.asp.net/QuickStart/aspnet...atasource.aspx


now, my rant....
It seems like vs2005 has taken us backwords. If we follow the MSDN
articles
it has us creating DataSources for our gridviews that puts SQL in our ASPX
pages (and that is not acceptable). vs2005 has also taken away our ability
to bind to datasets at design time - WHY? do I misunderstand?
==============================================
And the VS2003's approch is actually based on some autogenerated code
(inside the initializeComponents function...), this is sometimes a bit hard
to maintain since it is IDE autogenerated.... While vs 2005 use the new
datasource control model which avoid much IDE generated code.... Just put
datasource control at configure it in page template statically (no much
code needed....)

Also, though SQLDataSource control need to specify sql statement in aspx
template, you can choose to precompiled page so that no aspx content will
be exposed at deployment time... Also, sqldatasource provide a rapid data
access developing approach which is suitable for some simple application or
design prototype.... ObjectDataSource provide the more flexible and
advanced means to connect to different data access layer....

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>
| References: <ep*************@TK2MSFTNGP09.phx.gbl>
<PE**************@TK2MSFTNGXA02.phx.gbl>
| Subject: Re: 2.0 DataSources vs. TableAdapter/Datasets
| Date: Tue, 3 Jan 2006 10:25:25 -0800
| Lines: 135
| 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: <ug**************@tk2msftngp13.phx.gbl>
| Newsgroups: microsoft.public.dotnet.framework.aspnet
| NNTP-Posting-Host: user-vcauk40.dsl.mindspring.com 216.175.80.128
| Path: TK2MSFTNGXA02.phx.gbl!TK2MSFTNGP08.phx.gbl!tk2msft ngp13.phx.gbl
| Xref: TK2MSFTNGXA02.phx.gbl
microsoft.public.dotnet.framework.aspnet:368327
| X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
|
| Steven,
| Please tell me if this is correct...
|
| I can create a .xsd and TableAdapter for an ASP app in design time.
However
| vs.net 2005 does not allow me to connect that .xsd to my GridView at
design
| time (as did vs 2003 allowed me to connect a .xsd to my DataGrid). So
| because of this weakness I should do the following.....
|
| Create a .xsd in my App_Code folder. Create a class in my App_Code
folder
| that returns this dataset. Call this class from my aspx pages.
|
| Is this the best practice???
|
| now, my rant....
| It seems like vs2005 has taken us backwords. If we follow the MSDN
articles
| it has us creating DataSources for our gridviews that puts SQL in our
ASPX
| pages (and that is not acceptable). vs2005 has also taken away our
ability
| to bind to datasets at design time - WHY? do I misunderstand?
|
| --
| Regards,
| Gary Blakely
| "Steven Cheng[MSFT]" <st*****@online.microsoft.com> wrote in message
| news:PE**************@TK2MSFTNGXA02.phx.gbl...
| > Hi Gary,
| >
| > Welcome.
| > As for the TableAdapter's different design mode and behavior in .net 2.0
| > winform app and asp.net application ,here are some of my understanding
and
| > suggestions:
| >
| > For the different design-time support and behavior on using
TableAdpater
| > components in winform application and asp.net application, it is due to
| > the
| > different underlying application nature and programming model. Winform
| > application is desktop app where all the class instances and componets
| > live
| > in the application's memorty space as long as the application keep
| > alive...
| > While for asp.net application, it is request/response based, asp.net
page
| > instance only live when a request arrive server and being processed,
after
| > request finished, the page object will disposed(also, mulitple page
| > instances won't have relations to each other.... ) , so we should not
use
| > the same programming model as winform app.
| >
| > For sharing component instance or class objects in asp.net application,
we
| > can use the following means:
| >
| > 1. Create the shared component instance and store it in a global wide
| > storage, e.g the ApplicationState or Application Cache is the reasonable
| > place for storing such component....
| >
| > 2. Also, if your applcation always running in a single appdomain, you
can
| > consider using a certain class's public static member property to hold
| > such
| > shared data or resources so that all the pages requests can reference
| > those
| > shared objects....
| >
| > In addition, ASP.NET appliation in VS.NET can help us create typed
| > dataset
| > and a TableAdapter through design surface, however, as I mentioned, due
to
| > the different programming model, ASP.NET will have limited support on
| > using
| > TableAdpater as winform application at design-time.... but since
| > TableAdapter has encapsulated most code, we can just declare certain
| > vartiables and create the instance to use them.....
| >
| > 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 DataSources vs. TableAdapter/Datasets
| > | Date: Sat, 31 Dec 2005 14:29:31 -0800
| > | Lines: 25
| > | 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: <ep*************@TK2MSFTNGP09.phx.gbl>
| > | Newsgroups: microsoft.public.dotnet.framework.aspnet
| > | NNTP-Posting-Host: user-vcaur7q.dsl.mindspring.com 216.175.108.250
| > | Path: TK2MSFTNGXA02.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFT NGP09.phx.gbl
| > | Xref: TK2MSFTNGXA02.phx.gbl
| > microsoft.public.dotnet.framework.aspnet:367882
| > | X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
| > |
| > | We have been noticing that questions on vs.2005/2.0 don't appear to
get
| > much
| > | in answers so I'm reposting some questions posted by some of the
| > programmers
| > | here in our organization that never got answered...
| > |
| > | There are articles on the new TableAdapters where it says that a key
new
| > | advantage is that a single TableAdapter, which can have multiple
| > queries,
| > | can be used on multiple forms. Now that was in an article on using
| > | TableAdapters with Forms Apps. There is a DataSource window that
stores
| > | common datasources for the whole project (accessed via the Data menu
| > item).
| > |
| > | Now, back to ASP apps - there is no Data on the menu, no datasource
| > window,
| > | and it looks like TableAdapters need to be generated from a DataSource
| > | dropped on a page. Does this mean that aspx pages won't be able to
| > share
| > | TableAdapters?
| > |
| > | Also, in Form apps the IDE guids us to create the new 2.0 .XSD
datasets
| > that
| > | have TableAdapters where the ASP IDE guids us to create DataSources
that
| > | don't create .XSDs with TableAdapters. Why the difference?
| > |
| > |
| > | --
| > | Regards,
| > | Gary Blakely
| > |
| > |
| > |
| >
|
|
|

Jan 4 '06 #4
Steven:
I read the article you provided the hyperlink to with great interest. After
spending hours pouring over the details in that article and reading the help
on ObjectDataSource.Typename property I cannot determine what to put into
the ObjectDataSource Typename property. These docs are soooo bad.

The article you pointed me to has
TypeName="DataSetTableAdapters.PhotosTableAdapter" in the typename property
but there is no information at all on what DataSetTableAdapters is -
nothing.

I have in my asp project Dataset1.xsd with a dataset named Orders and a
TableAdapter named OrdersTableAdapter with methods FillOrders and GetOrders.
None of these names can be used in the Page_Load event as they are all not
defined.

If you click on View Source in this article it is using
TypeName="DataComponentTableAdapters.AlbumsTableAd apter" which seems at odds
with the article.

The Help file for the Typename property shows
typename="Samples.AspNet.CS.EmployeeLogic" but offers no explainations of
where that came from or what that means. The help file says that the
TypeName property Gets or sets the name of the class that the
ObjectDataSource object represents.

So, I cannot figure out what to put in the typename property - I can't
figure out what the classname is.

What should I put in the TypeName property?

thanks,
Gary

--
Regards,
Gary Blakely
Dean Blakely & Associates
www.deanblakely.com
"Steven Cheng[MSFT]" <st*****@online.microsoft.com> wrote in message
news:c4**************@TK2MSFTNGXA02.phx.gbl...
Thanks for your response Gary,

My answers in line:

I can create a .xsd and TableAdapter for an ASP app in design time.
However
vs.net 2005 does not allow me to connect that .xsd to my GridView at
design
time (as did vs 2003 allowed me to connect a .xsd to my DataGrid). So
because of this weakness I should do the following.....

Create a .xsd in my App_Code folder. Create a class in my App_Code folder
that returns this dataset. Call this class from my aspx pages.

Is this the best practice???
=============================================
Of course we can connect the created TableAdapter/ typed Dataset to the
DataBound control at design-time, just use the ObjectDatasource control,
and the steps to do this is:

i) create the DataSet/TableAdatper pairs through wizard....
ii)drag a ObjectDataSource control onto the page want to use that
TableAdapter/DataSet to retrieve data....
iii) configure the ObjectDataSource control to use the TableAdapter as the
component class
iv) connect the databoundcontrol(gridview, detailsview...) to the
objectdatasource...

Here is the quickstart example which contains bind a tableadapter/dataset
to asp.net databound control at design-time...:

#ObjectDataSource
http://www.asp.net/QuickStart/aspnet...atasource.aspx


now, my rant....
It seems like vs2005 has taken us backwords. If we follow the MSDN
articles
it has us creating DataSources for our gridviews that puts SQL in our ASPX
pages (and that is not acceptable). vs2005 has also taken away our
ability
to bind to datasets at design time - WHY? do I misunderstand?
==============================================
And the VS2003's approch is actually based on some autogenerated code
(inside the initializeComponents function...), this is sometimes a bit
hard
to maintain since it is IDE autogenerated.... While vs 2005 use the new
datasource control model which avoid much IDE generated code.... Just put
datasource control at configure it in page template statically (no much
code needed....)

Also, though SQLDataSource control need to specify sql statement in aspx
template, you can choose to precompiled page so that no aspx content will
be exposed at deployment time... Also, sqldatasource provide a rapid data
access developing approach which is suitable for some simple application
or
design prototype.... ObjectDataSource provide the more flexible and
advanced means to connect to different data access layer....

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>
| References: <ep*************@TK2MSFTNGP09.phx.gbl>
<PE**************@TK2MSFTNGXA02.phx.gbl>
| Subject: Re: 2.0 DataSources vs. TableAdapter/Datasets
| Date: Tue, 3 Jan 2006 10:25:25 -0800
| Lines: 135
| 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: <ug**************@tk2msftngp13.phx.gbl>
| Newsgroups: microsoft.public.dotnet.framework.aspnet
| NNTP-Posting-Host: user-vcauk40.dsl.mindspring.com 216.175.80.128
| Path: TK2MSFTNGXA02.phx.gbl!TK2MSFTNGP08.phx.gbl!tk2msft ngp13.phx.gbl
| Xref: TK2MSFTNGXA02.phx.gbl
microsoft.public.dotnet.framework.aspnet:368327
| X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
|
| Steven,
| Please tell me if this is correct...
|
| I can create a .xsd and TableAdapter for an ASP app in design time.
However
| vs.net 2005 does not allow me to connect that .xsd to my GridView at
design
| time (as did vs 2003 allowed me to connect a .xsd to my DataGrid). So
| because of this weakness I should do the following.....
|
| Create a .xsd in my App_Code folder. Create a class in my App_Code
folder
| that returns this dataset. Call this class from my aspx pages.
|
| Is this the best practice???
|
| now, my rant....
| It seems like vs2005 has taken us backwords. If we follow the MSDN
articles
| it has us creating DataSources for our gridviews that puts SQL in our
ASPX
| pages (and that is not acceptable). vs2005 has also taken away our
ability
| to bind to datasets at design time - WHY? do I misunderstand?
|
| --
| Regards,
| Gary Blakely
| "Steven Cheng[MSFT]" <st*****@online.microsoft.com> wrote in message
| news:PE**************@TK2MSFTNGXA02.phx.gbl...
| > Hi Gary,
| >
| > Welcome.
| > As for the TableAdapter's different design mode and behavior in .net
2.0
| > winform app and asp.net application ,here are some of my understanding
and
| > suggestions:
| >
| > For the different design-time support and behavior on using
TableAdpater
| > components in winform application and asp.net application, it is due
to
| > the
| > different underlying application nature and programming model. Winform
| > application is desktop app where all the class instances and componets
| > live
| > in the application's memorty space as long as the application keep
| > alive...
| > While for asp.net application, it is request/response based, asp.net
page
| > instance only live when a request arrive server and being processed,
after
| > request finished, the page object will disposed(also, mulitple page
| > instances won't have relations to each other.... ) , so we should not
use
| > the same programming model as winform app.
| >
| > For sharing component instance or class objects in asp.net
application,
we
| > can use the following means:
| >
| > 1. Create the shared component instance and store it in a global wide
| > storage, e.g the ApplicationState or Application Cache is the
reasonable
| > place for storing such component....
| >
| > 2. Also, if your applcation always running in a single appdomain, you
can
| > consider using a certain class's public static member property to hold
| > such
| > shared data or resources so that all the pages requests can reference
| > those
| > shared objects....
| >
| > In addition, ASP.NET appliation in VS.NET can help us create typed
| > dataset
| > and a TableAdapter through design surface, however, as I mentioned,
due
to
| > the different programming model, ASP.NET will have limited support on
| > using
| > TableAdpater as winform application at design-time.... but since
| > TableAdapter has encapsulated most code, we can just declare certain
| > vartiables and create the instance to use them.....
| >
| > 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 DataSources vs. TableAdapter/Datasets
| > | Date: Sat, 31 Dec 2005 14:29:31 -0800
| > | Lines: 25
| > | 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: <ep*************@TK2MSFTNGP09.phx.gbl>
| > | Newsgroups: microsoft.public.dotnet.framework.aspnet
| > | NNTP-Posting-Host: user-vcaur7q.dsl.mindspring.com 216.175.108.250
| > | Path:
TK2MSFTNGXA02.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFT NGP09.phx.gbl
| > | Xref: TK2MSFTNGXA02.phx.gbl
| > microsoft.public.dotnet.framework.aspnet:367882
| > | X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
| > |
| > | We have been noticing that questions on vs.2005/2.0 don't appear to
get
| > much
| > | in answers so I'm reposting some questions posted by some of the
| > programmers
| > | here in our organization that never got answered...
| > |
| > | There are articles on the new TableAdapters where it says that a key
new
| > | advantage is that a single TableAdapter, which can have multiple
| > queries,
| > | can be used on multiple forms. Now that was in an article on using
| > | TableAdapters with Forms Apps. There is a DataSource window that
stores
| > | common datasources for the whole project (accessed via the Data menu
| > item).
| > |
| > | Now, back to ASP apps - there is no Data on the menu, no datasource
| > window,
| > | and it looks like TableAdapters need to be generated from a
DataSource
| > | dropped on a page. Does this mean that aspx pages won't be able to
| > share
| > | TableAdapters?
| > |
| > | Also, in Form apps the IDE guids us to create the new 2.0 .XSD
datasets
| > that
| > | have TableAdapters where the ASP IDE guids us to create DataSources
that
| > | don't create .XSDs with TableAdapters. Why the difference?
| > |
| > |
| > | --
| > | Regards,
| > | Gary Blakely
| > |
| > |
| > |
| >
|
|
|

Jan 6 '06 #5
Thanks for your followup Gary,

For TypeName, it just let us specify the Data Access Class's class name,
also, as for
==========
but there is no information at all on what DataSetTableAdapters is -
nothing.
==========

this is nothing related with ObjectDataSource or TableAdapter, it is just a
Namespace of the class(TableAdapter...). As we know, in .net framework, we
can group classes into a given namespace so as to avoid name clash with
other company or studio's component package....

So for the VS IDE generated TAbleAdapter/Dataset, they'll be assigned a
namespace, e.g:

the following objectdatasource use a TableAdapter which has the namespace
"DataSet1TableAdapters",

=======================
<asp:ObjectDataSource ID="ObjectDataSource1" runat="server" .........
SelectMethod="GetData"
TypeName="DataSet1TableAdapters.CategoriesTableAda pter"
..........>
======================

#namespace
http://msdn.microsoft.com/library/en...ace.asp?frame=
true

Also, if you're using VS IDE, you can use the design-time smart Tag wizard
to list all the available data accessing components(include TableAdapters )
in this project...

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>
| References: <ep*************@TK2MSFTNGP09.phx.gbl>
<PE**************@TK2MSFTNGXA02.phx.gbl>
<ug**************@tk2msftngp13.phx.gbl>
<c4**************@TK2MSFTNGXA02.phx.gbl>
| Subject: Re: 2.0 DataSources vs. TableAdapter/Datasets
| Date: Thu, 5 Jan 2006 18:10:27 -0800
| Lines: 310
| 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: <O8**************@TK2MSFTNGP15.phx.gbl>
| Newsgroups: microsoft.public.dotnet.framework.aspnet
| NNTP-Posting-Host: 216.244.8.41
| Path: TK2MSFTNGXA02.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFT NGP15.phx.gbl
| Xref: TK2MSFTNGXA02.phx.gbl
microsoft.public.dotnet.framework.aspnet:368939
| X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
|
| Steven:
| I read the article you provided the hyperlink to with great interest.
After
| spending hours pouring over the details in that article and reading the
help
| on ObjectDataSource.Typename property I cannot determine what to put into
| the ObjectDataSource Typename property. These docs are soooo bad.
|
| The article you pointed me to has
| TypeName="DataSetTableAdapters.PhotosTableAdapter" in the typename
property
| but there is no information at all on what DataSetTableAdapters is -
| nothing.
|
| I have in my asp project Dataset1.xsd with a dataset named Orders and a
| TableAdapter named OrdersTableAdapter with methods FillOrders and
GetOrders.
| None of these names can be used in the Page_Load event as they are all
not
| defined.
|
| If you click on View Source in this article it is using
| TypeName="DataComponentTableAdapters.AlbumsTableAd apter" which seems at
odds
| with the article.
|
| The Help file for the Typename property shows
| typename="Samples.AspNet.CS.EmployeeLogic" but offers no explainations of
| where that came from or what that means. The help file says that the
| TypeName property Gets or sets the name of the class that the
| ObjectDataSource object represents.
|
| So, I cannot figure out what to put in the typename property - I can't
| figure out what the classname is.
|
| What should I put in the TypeName property?
|
| thanks,
| Gary
|
|
|
|
|
| --
| Regards,
| Gary Blakely
| Dean Blakely & Associates
| www.deanblakely.com
| "Steven Cheng[MSFT]" <st*****@online.microsoft.com> wrote in message
| news:c4**************@TK2MSFTNGXA02.phx.gbl...
| > Thanks for your response Gary,
| >
| > My answers in line:
| >
| > I can create a .xsd and TableAdapter for an ASP app in design time.
| > However
| > vs.net 2005 does not allow me to connect that .xsd to my GridView at
| > design
| > time (as did vs 2003 allowed me to connect a .xsd to my DataGrid). So
| > because of this weakness I should do the following.....
| >
| > Create a .xsd in my App_Code folder. Create a class in my App_Code
folder
| > that returns this dataset. Call this class from my aspx pages.
| >
| > Is this the best practice???
| > =============================================
| > Of course we can connect the created TableAdapter/ typed Dataset to the
| > DataBound control at design-time, just use the ObjectDatasource control,
| > and the steps to do this is:
| >
| > i) create the DataSet/TableAdatper pairs through wizard....
| > ii)drag a ObjectDataSource control onto the page want to use that
| > TableAdapter/DataSet to retrieve data....
| > iii) configure the ObjectDataSource control to use the TableAdapter as
the
| > component class
| > iv) connect the databoundcontrol(gridview, detailsview...) to the
| > objectdatasource...
| >
| > Here is the quickstart example which contains bind a
tableadapter/dataset
| > to asp.net databound control at design-time...:
| >
| > #ObjectDataSource
| >
http://www.asp.net/QuickStart/aspnet...atasource.aspx
| >
| >
| >
| >
| > now, my rant....
| > It seems like vs2005 has taken us backwords. If we follow the MSDN
| > articles
| > it has us creating DataSources for our gridviews that puts SQL in our
ASPX
| > pages (and that is not acceptable). vs2005 has also taken away our
| > ability
| > to bind to datasets at design time - WHY? do I misunderstand?
| > ==============================================
| > And the VS2003's approch is actually based on some autogenerated code
| > (inside the initializeComponents function...), this is sometimes a bit
| > hard
| > to maintain since it is IDE autogenerated.... While vs 2005 use the
new
| > datasource control model which avoid much IDE generated code.... Just
put
| > datasource control at configure it in page template statically (no much
| > code needed....)
| >
| > Also, though SQLDataSource control need to specify sql statement in aspx
| > template, you can choose to precompiled page so that no aspx content
will
| > be exposed at deployment time... Also, sqldatasource provide a rapid
data
| > access developing approach which is suitable for some simple
application
| > or
| > design prototype.... ObjectDataSource provide the more flexible and
| > advanced means to connect to different data access layer....
| >
| > 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>
| > | References: <ep*************@TK2MSFTNGP09.phx.gbl>
| > <PE**************@TK2MSFTNGXA02.phx.gbl>
| > | Subject: Re: 2.0 DataSources vs. TableAdapter/Datasets
| > | Date: Tue, 3 Jan 2006 10:25:25 -0800
| > | Lines: 135
| > | 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: <ug**************@tk2msftngp13.phx.gbl>
| > | Newsgroups: microsoft.public.dotnet.framework.aspnet
| > | NNTP-Posting-Host: user-vcauk40.dsl.mindspring.com 216.175.80.128
| > | Path: TK2MSFTNGXA02.phx.gbl!TK2MSFTNGP08.phx.gbl!tk2msft ngp13.phx.gbl
| > | Xref: TK2MSFTNGXA02.phx.gbl
| > microsoft.public.dotnet.framework.aspnet:368327
| > | X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
| > |
| > | Steven,
| > | Please tell me if this is correct...
| > |
| > | I can create a .xsd and TableAdapter for an ASP app in design time.
| > However
| > | vs.net 2005 does not allow me to connect that .xsd to my GridView at
| > design
| > | time (as did vs 2003 allowed me to connect a .xsd to my DataGrid). So
| > | because of this weakness I should do the following.....
| > |
| > | Create a .xsd in my App_Code folder. Create a class in my App_Code
| > folder
| > | that returns this dataset. Call this class from my aspx pages.
| > |
| > | Is this the best practice???
| > |
| > | now, my rant....
| > | It seems like vs2005 has taken us backwords. If we follow the MSDN
| > articles
| > | it has us creating DataSources for our gridviews that puts SQL in our
| > ASPX
| > | pages (and that is not acceptable). vs2005 has also taken away our
| > ability
| > | to bind to datasets at design time - WHY? do I misunderstand?
| > |
| > | --
| > | Regards,
| > | Gary Blakely
| > | "Steven Cheng[MSFT]" <st*****@online.microsoft.com> wrote in message
| > | news:PE**************@TK2MSFTNGXA02.phx.gbl...
| > | > Hi Gary,
| > | >
| > | > Welcome.
| > | > As for the TableAdapter's different design mode and behavior in
.net
| > 2.0
| > | > winform app and asp.net application ,here are some of my
understanding
| > and
| > | > suggestions:
| > | >
| > | > For the different design-time support and behavior on using
| > TableAdpater
| > | > components in winform application and asp.net application, it is
due
| > to
| > | > the
| > | > different underlying application nature and programming model.
Winform
| > | > application is desktop app where all the class instances and
componets
| > | > live
| > | > in the application's memorty space as long as the application keep
| > | > alive...
| > | > While for asp.net application, it is request/response based, asp.net
| > page
| > | > instance only live when a request arrive server and being processed,
| > after
| > | > request finished, the page object will disposed(also, mulitple page
| > | > instances won't have relations to each other.... ) , so we should
not
| > use
| > | > the same programming model as winform app.
| > | >
| > | > For sharing component instance or class objects in asp.net
| > application,
| > we
| > | > can use the following means:
| > | >
| > | > 1. Create the shared component instance and store it in a global
wide
| > | > storage, e.g the ApplicationState or Application Cache is the
| > reasonable
| > | > place for storing such component....
| > | >
| > | > 2. Also, if your applcation always running in a single appdomain,
you
| > can
| > | > consider using a certain class's public static member property to
hold
| > | > such
| > | > shared data or resources so that all the pages requests can
reference
| > | > those
| > | > shared objects....
| > | >
| > | > In addition, ASP.NET appliation in VS.NET can help us create typed
| > | > dataset
| > | > and a TableAdapter through design surface, however, as I mentioned,
| > due
| > to
| > | > the different programming model, ASP.NET will have limited support
on
| > | > using
| > | > TableAdpater as winform application at design-time.... but since
| > | > TableAdapter has encapsulated most code, we can just declare certain
| > | > vartiables and create the instance to use them.....
| > | >
| > | > 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 DataSources vs. TableAdapter/Datasets
| > | > | Date: Sat, 31 Dec 2005 14:29:31 -0800
| > | > | Lines: 25
| > | > | 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: <ep*************@TK2MSFTNGP09.phx.gbl>
| > | > | Newsgroups: microsoft.public.dotnet.framework.aspnet
| > | > | NNTP-Posting-Host: user-vcaur7q.dsl.mindspring.com 216.175.108.250
| > | > | Path:
| > TK2MSFTNGXA02.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFT NGP09.phx.gbl
| > | > | Xref: TK2MSFTNGXA02.phx.gbl
| > | > microsoft.public.dotnet.framework.aspnet:367882
| > | > | X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
| > | > |
| > | > | We have been noticing that questions on vs.2005/2.0 don't appear
to
| > get
| > | > much
| > | > | in answers so I'm reposting some questions posted by some of the
| > | > programmers
| > | > | here in our organization that never got answered...
| > | > |
| > | > | There are articles on the new TableAdapters where it says that a
key
| > new
| > | > | advantage is that a single TableAdapter, which can have multiple
| > | > queries,
| > | > | can be used on multiple forms. Now that was in an article on
using
| > | > | TableAdapters with Forms Apps. There is a DataSource window that
| > stores
| > | > | common datasources for the whole project (accessed via the Data
menu
| > | > item).
| > | > |
| > | > | Now, back to ASP apps - there is no Data on the menu, no
datasource
| > | > window,
| > | > | and it looks like TableAdapters need to be generated from a
| > DataSource
| > | > | dropped on a page. Does this mean that aspx pages won't be able
to
| > | > share
| > | > | TableAdapters?
| > | > |
| > | > | Also, in Form apps the IDE guids us to create the new 2.0 .XSD
| > datasets
| > | > that
| > | > | have TableAdapters where the ASP IDE guids us to create
DataSources
| > that
| > | > | don't create .XSDs with TableAdapters. Why the difference?
| > | > |
| > | > |
| > | > | --
| > | > | Regards,
| > | > | Gary Blakely
| > | > |
| > | > |
| > | > |
| > | >
| > |
| > |
| > |
| >
|
|
|

Jan 6 '06 #6
I'm having a hare time communicating my problem....

I know that I need to specify the Datasets Class name in the typename
property. My problem is that I can't find out where that class name is
specified! there is just a DataSet1.xsd and a DataSet1.xss file and neither
of those files have anything such as a class name.

How do I find the class name??????\

(in a forms app I created, I just had to double click the node of the .xsd
file and a datasetDesigner.vb file got generated but this does not work in
my asp app)

Still searching for that magical class name...
--
Regards,
Gary Blakely
"Steven Cheng[MSFT]" <st*****@online.microsoft.com> wrote in message
news:S$**************@TK2MSFTNGXA02.phx.gbl...
Thanks for your followup Gary,

For TypeName, it just let us specify the Data Access Class's class name,
also, as for
==========
but there is no information at all on what DataSetTableAdapters is -
nothing.
==========

this is nothing related with ObjectDataSource or TableAdapter, it is just
a
Namespace of the class(TableAdapter...). As we know, in .net framework, we
can group classes into a given namespace so as to avoid name clash with
other company or studio's component package....

So for the VS IDE generated TAbleAdapter/Dataset, they'll be assigned a
namespace, e.g:

the following objectdatasource use a TableAdapter which has the namespace
"DataSet1TableAdapters",

=======================
<asp:ObjectDataSource ID="ObjectDataSource1" runat="server" .........
SelectMethod="GetData"
TypeName="DataSet1TableAdapters.CategoriesTableAda pter"
.........>
======================

#namespace
http://msdn.microsoft.com/library/en...ace.asp?frame=
true

Also, if you're using VS IDE, you can use the design-time smart Tag wizard
to list all the available data accessing components(include
TableAdapters )
in this project...

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>
| References: <ep*************@TK2MSFTNGP09.phx.gbl>
<PE**************@TK2MSFTNGXA02.phx.gbl>
<ug**************@tk2msftngp13.phx.gbl>
<c4**************@TK2MSFTNGXA02.phx.gbl>
| Subject: Re: 2.0 DataSources vs. TableAdapter/Datasets
| Date: Thu, 5 Jan 2006 18:10:27 -0800
| Lines: 310
| 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: <O8**************@TK2MSFTNGP15.phx.gbl>
| Newsgroups: microsoft.public.dotnet.framework.aspnet
| NNTP-Posting-Host: 216.244.8.41
| Path: TK2MSFTNGXA02.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFT NGP15.phx.gbl
| Xref: TK2MSFTNGXA02.phx.gbl
microsoft.public.dotnet.framework.aspnet:368939
| X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
|
| Steven:
| I read the article you provided the hyperlink to with great interest.
After
| spending hours pouring over the details in that article and reading the
help
| on ObjectDataSource.Typename property I cannot determine what to put
into
| the ObjectDataSource Typename property. These docs are soooo bad.
|
| The article you pointed me to has
| TypeName="DataSetTableAdapters.PhotosTableAdapter" in the typename
property
| but there is no information at all on what DataSetTableAdapters is -
| nothing.
|
| I have in my asp project Dataset1.xsd with a dataset named Orders and a
| TableAdapter named OrdersTableAdapter with methods FillOrders and
GetOrders.
| None of these names can be used in the Page_Load event as they are all
not
| defined.
|
| If you click on View Source in this article it is using
| TypeName="DataComponentTableAdapters.AlbumsTableAd apter" which seems at
odds
| with the article.
|
| The Help file for the Typename property shows
| typename="Samples.AspNet.CS.EmployeeLogic" but offers no explainations
of
| where that came from or what that means. The help file says that the
| TypeName property Gets or sets the name of the class that the
| ObjectDataSource object represents.
|
| So, I cannot figure out what to put in the typename property - I can't
| figure out what the classname is.
|
| What should I put in the TypeName property?
|
| thanks,
| Gary
|
|
|
|
|
| --
| Regards,
| Gary Blakely
| Dean Blakely & Associates
| www.deanblakely.com
| "Steven Cheng[MSFT]" <st*****@online.microsoft.com> wrote in message
| news:c4**************@TK2MSFTNGXA02.phx.gbl...
| > Thanks for your response Gary,
| >
| > My answers in line:
| >
| > I can create a .xsd and TableAdapter for an ASP app in design time.
| > However
| > vs.net 2005 does not allow me to connect that .xsd to my GridView at
| > design
| > time (as did vs 2003 allowed me to connect a .xsd to my DataGrid). So
| > because of this weakness I should do the following.....
| >
| > Create a .xsd in my App_Code folder. Create a class in my App_Code
folder
| > that returns this dataset. Call this class from my aspx pages.
| >
| > Is this the best practice???
| > =============================================
| > Of course we can connect the created TableAdapter/ typed Dataset to
the
| > DataBound control at design-time, just use the ObjectDatasource
control,
| > and the steps to do this is:
| >
| > i) create the DataSet/TableAdatper pairs through wizard....
| > ii)drag a ObjectDataSource control onto the page want to use that
| > TableAdapter/DataSet to retrieve data....
| > iii) configure the ObjectDataSource control to use the TableAdapter as
the
| > component class
| > iv) connect the databoundcontrol(gridview, detailsview...) to the
| > objectdatasource...
| >
| > Here is the quickstart example which contains bind a
tableadapter/dataset
| > to asp.net databound control at design-time...:
| >
| > #ObjectDataSource
| >
http://www.asp.net/QuickStart/aspnet...atasource.aspx
| >
| >
| >
| >
| > now, my rant....
| > It seems like vs2005 has taken us backwords. If we follow the MSDN
| > articles
| > it has us creating DataSources for our gridviews that puts SQL in our
ASPX
| > pages (and that is not acceptable). vs2005 has also taken away our
| > ability
| > to bind to datasets at design time - WHY? do I misunderstand?
| > ==============================================
| > And the VS2003's approch is actually based on some autogenerated code
| > (inside the initializeComponents function...), this is sometimes a bit
| > hard
| > to maintain since it is IDE autogenerated.... While vs 2005 use the
new
| > datasource control model which avoid much IDE generated code.... Just
put
| > datasource control at configure it in page template statically (no
much
| > code needed....)
| >
| > Also, though SQLDataSource control need to specify sql statement in
aspx
| > template, you can choose to precompiled page so that no aspx content
will
| > be exposed at deployment time... Also, sqldatasource provide a rapid
data
| > access developing approach which is suitable for some simple
application
| > or
| > design prototype.... ObjectDataSource provide the more flexible and
| > advanced means to connect to different data access layer....
| >
| > 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>
| > | References: <ep*************@TK2MSFTNGP09.phx.gbl>
| > <PE**************@TK2MSFTNGXA02.phx.gbl>
| > | Subject: Re: 2.0 DataSources vs. TableAdapter/Datasets
| > | Date: Tue, 3 Jan 2006 10:25:25 -0800
| > | Lines: 135
| > | 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: <ug**************@tk2msftngp13.phx.gbl>
| > | Newsgroups: microsoft.public.dotnet.framework.aspnet
| > | NNTP-Posting-Host: user-vcauk40.dsl.mindspring.com 216.175.80.128
| > | Path:
TK2MSFTNGXA02.phx.gbl!TK2MSFTNGP08.phx.gbl!tk2msft ngp13.phx.gbl
| > | Xref: TK2MSFTNGXA02.phx.gbl
| > microsoft.public.dotnet.framework.aspnet:368327
| > | X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
| > |
| > | Steven,
| > | Please tell me if this is correct...
| > |
| > | I can create a .xsd and TableAdapter for an ASP app in design time.
| > However
| > | vs.net 2005 does not allow me to connect that .xsd to my GridView at
| > design
| > | time (as did vs 2003 allowed me to connect a .xsd to my DataGrid).
So
| > | because of this weakness I should do the following.....
| > |
| > | Create a .xsd in my App_Code folder. Create a class in my App_Code
| > folder
| > | that returns this dataset. Call this class from my aspx pages.
| > |
| > | Is this the best practice???
| > |
| > | now, my rant....
| > | It seems like vs2005 has taken us backwords. If we follow the MSDN
| > articles
| > | it has us creating DataSources for our gridviews that puts SQL in
our
| > ASPX
| > | pages (and that is not acceptable). vs2005 has also taken away our
| > ability
| > | to bind to datasets at design time - WHY? do I misunderstand?
| > |
| > | --
| > | Regards,
| > | Gary Blakely
| > | "Steven Cheng[MSFT]" <st*****@online.microsoft.com> wrote in message
| > | news:PE**************@TK2MSFTNGXA02.phx.gbl...
| > | > Hi Gary,
| > | >
| > | > Welcome.
| > | > As for the TableAdapter's different design mode and behavior in
net
| > 2.0
| > | > winform app and asp.net application ,here are some of my
understanding
| > and
| > | > suggestions:
| > | >
| > | > For the different design-time support and behavior on using
| > TableAdpater
| > | > components in winform application and asp.net application, it is
due
| > to
| > | > the
| > | > different underlying application nature and programming model.
Winform
| > | > application is desktop app where all the class instances and
componets
| > | > live
| > | > in the application's memorty space as long as the application keep
| > | > alive...
| > | > While for asp.net application, it is request/response based,
asp.net
| > page
| > | > instance only live when a request arrive server and being
processed,
| > after
| > | > request finished, the page object will disposed(also, mulitple
page
| > | > instances won't have relations to each other.... ) , so we should
not
| > use
| > | > the same programming model as winform app.
| > | >
| > | > For sharing component instance or class objects in asp.net
| > application,
| > we
| > | > can use the following means:
| > | >
| > | > 1. Create the shared component instance and store it in a global
wide
| > | > storage, e.g the ApplicationState or Application Cache is the
| > reasonable
| > | > place for storing such component....
| > | >
| > | > 2. Also, if your applcation always running in a single appdomain,
you
| > can
| > | > consider using a certain class's public static member property to
hold
| > | > such
| > | > shared data or resources so that all the pages requests can
reference
| > | > those
| > | > shared objects....
| > | >
| > | > In addition, ASP.NET appliation in VS.NET can help us create
typed
| > | > dataset
| > | > and a TableAdapter through design surface, however, as I
mentioned,
| > due
| > to
| > | > the different programming model, ASP.NET will have limited support
on
| > | > using
| > | > TableAdpater as winform application at design-time.... but since
| > | > TableAdapter has encapsulated most code, we can just declare
certain
| > | > vartiables and create the instance to use them.....
| > | >
| > | > 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 DataSources vs. TableAdapter/Datasets
| > | > | Date: Sat, 31 Dec 2005 14:29:31 -0800
| > | > | Lines: 25
| > | > | 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: <ep*************@TK2MSFTNGP09.phx.gbl>
| > | > | Newsgroups: microsoft.public.dotnet.framework.aspnet
| > | > | NNTP-Posting-Host: user-vcaur7q.dsl.mindspring.com
216.175.108.250
| > | > | Path:
| > TK2MSFTNGXA02.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFT NGP09.phx.gbl
| > | > | Xref: TK2MSFTNGXA02.phx.gbl
| > | > microsoft.public.dotnet.framework.aspnet:367882
| > | > | X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
| > | > |
| > | > | We have been noticing that questions on vs.2005/2.0 don't appear
to
| > get
| > | > much
| > | > | in answers so I'm reposting some questions posted by some of the
| > | > programmers
| > | > | here in our organization that never got answered...
| > | > |
| > | > | There are articles on the new TableAdapters where it says that a
key
| > new
| > | > | advantage is that a single TableAdapter, which can have multiple
| > | > queries,
| > | > | can be used on multiple forms. Now that was in an article on
using
| > | > | TableAdapters with Forms Apps. There is a DataSource window
that
| > stores
| > | > | common datasources for the whole project (accessed via the Data
menu
| > | > item).
| > | > |
| > | > | Now, back to ASP apps - there is no Data on the menu, no
datasource
| > | > window,
| > | > | and it looks like TableAdapters need to be generated from a
| > DataSource
| > | > | dropped on a page. Does this mean that aspx pages won't be able
to
| > | > share
| > | > | TableAdapters?
| > | > |
| > | > | Also, in Form apps the IDE guids us to create the new 2.0 .XSD
| > datasets
| > | > that
| > | > | have TableAdapters where the ASP IDE guids us to create
DataSources
| > that
| > | > | don't create .XSDs with TableAdapters. Why the difference?
| > | > |
| > | > |
| > | > | --
| > | > | Regards,
| > | > | Gary Blakely
| > | > |
| > | > |
| > | > |
| > | >
| > |
| > |
| > |
| >
|
|
|

Jan 7 '06 #7
Hi Gary,

the xsd file in the App_Code folder is dynamically compiled into assembly
which contains the DataSet and TableAdapter classes, that's why you do not
find the designer.cs(vb) file as in winform project. To find the
TableAdapter class, just drag the ObjectDataSource and in the configuration
wizard, when you need to choose the Business Object, check the "show only
data components..."., the TableAdapter will appear in it...

Also, if you just want to view the generated TableAdapter classes , open
the "Class View" through View--->Class View menu item, then in the Class
view, you will find all the currently available classes in the project
which include the TableAdapter and DataSet ....

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>
| References: <ep*************@TK2MSFTNGP09.phx.gbl>
<PE**************@TK2MSFTNGXA02.phx.gbl>
<ug**************@tk2msftngp13.phx.gbl>
<c4**************@TK2MSFTNGXA02.phx.gbl>
<O8**************@TK2MSFTNGP15.phx.gbl>
<S$**************@TK2MSFTNGXA02.phx.gbl>
| Subject: Re: 2.0 DataSources vs. TableAdapter/Datasets
| Date: Fri, 6 Jan 2006 17:33:01 -0800
| Lines: 454
| 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: <uY**************@TK2MSFTNGP12.phx.gbl>
| Newsgroups: microsoft.public.dotnet.framework.aspnet
| NNTP-Posting-Host: 216.244.8.41
| Path: TK2MSFTNGXA02.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFT NGP12.phx.gbl
| Xref: TK2MSFTNGXA02.phx.gbl
microsoft.public.dotnet.framework.aspnet:369161
| X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
|
| I'm having a hare time communicating my problem....
|
| I know that I need to specify the Datasets Class name in the typename
| property. My problem is that I can't find out where that class name is
| specified! there is just a DataSet1.xsd and a DataSet1.xss file and
neither
| of those files have anything such as a class name.
|
| How do I find the class name??????\
|
| (in a forms app I created, I just had to double click the node of the
..xsd
| file and a datasetDesigner.vb file got generated but this does not work
in
| my asp app)
|
| Still searching for that magical class name...
| --
| Regards,
| Gary Blakely
| "Steven Cheng[MSFT]" <st*****@online.microsoft.com> wrote in message
| news:S$**************@TK2MSFTNGXA02.phx.gbl...
| > Thanks for your followup Gary,
| >
| > For TypeName, it just let us specify the Data Access Class's class name,
| > also, as for
| > ==========
| > but there is no information at all on what DataSetTableAdapters is -
| > nothing.
| > ==========
| >
| > this is nothing related with ObjectDataSource or TableAdapter, it is
just
| > a
| > Namespace of the class(TableAdapter...). As we know, in .net framework,
we
| > can group classes into a given namespace so as to avoid name clash with
| > other company or studio's component package....
| >
| > So for the VS IDE generated TAbleAdapter/Dataset, they'll be assigned a
| > namespace, e.g:
| >
| > the following objectdatasource use a TableAdapter which has the
namespace
| > "DataSet1TableAdapters",
| >
| > =======================
| > <asp:ObjectDataSource ID="ObjectDataSource1" runat="server" .........
| > SelectMethod="GetData"
| > TypeName="DataSet1TableAdapters.CategoriesTableAda pter"
| > .........>
| > ======================
| >
| > #namespace
| >
http://msdn.microsoft.com/library/en...ace.asp?frame=
| > true
| >
| > Also, if you're using VS IDE, you can use the design-time smart Tag
wizard
| > to list all the available data accessing components(include
| > TableAdapters )
| > in this project...
| >
| > 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>
| > | References: <ep*************@TK2MSFTNGP09.phx.gbl>
| > <PE**************@TK2MSFTNGXA02.phx.gbl>
| > <ug**************@tk2msftngp13.phx.gbl>
| > <c4**************@TK2MSFTNGXA02.phx.gbl>
| > | Subject: Re: 2.0 DataSources vs. TableAdapter/Datasets
| > | Date: Thu, 5 Jan 2006 18:10:27 -0800
| > | Lines: 310
| > | 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: <O8**************@TK2MSFTNGP15.phx.gbl>
| > | Newsgroups: microsoft.public.dotnet.framework.aspnet
| > | NNTP-Posting-Host: 216.244.8.41
| > | Path: TK2MSFTNGXA02.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFT NGP15.phx.gbl
| > | Xref: TK2MSFTNGXA02.phx.gbl
| > microsoft.public.dotnet.framework.aspnet:368939
| > | X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
| > |
| > | Steven:
| > | I read the article you provided the hyperlink to with great interest.
| > After
| > | spending hours pouring over the details in that article and reading
the
| > help
| > | on ObjectDataSource.Typename property I cannot determine what to put
| > into
| > | the ObjectDataSource Typename property. These docs are soooo bad.
| > |
| > | The article you pointed me to has
| > | TypeName="DataSetTableAdapters.PhotosTableAdapter" in the typename
| > property
| > | but there is no information at all on what DataSetTableAdapters is -
| > | nothing.
| > |
| > | I have in my asp project Dataset1.xsd with a dataset named Orders and
a
| > | TableAdapter named OrdersTableAdapter with methods FillOrders and
| > GetOrders.
| > | None of these names can be used in the Page_Load event as they are all
| > not
| > | defined.
| > |
| > | If you click on View Source in this article it is using
| > | TypeName="DataComponentTableAdapters.AlbumsTableAd apter" which seems
at
| > odds
| > | with the article.
| > |
| > | The Help file for the Typename property shows
| > | typename="Samples.AspNet.CS.EmployeeLogic" but offers no
explainations
| > of
| > | where that came from or what that means. The help file says that the
| > | TypeName property Gets or sets the name of the class that the
| > | ObjectDataSource object represents.
| > |
| > | So, I cannot figure out what to put in the typename property - I can't
| > | figure out what the classname is.
| > |
| > | What should I put in the TypeName property?
| > |
| > | thanks,
| > | Gary
| > |
| > |
| > |
| > |
| > |
| > | --
| > | Regards,
| > | Gary Blakely
| > | Dean Blakely & Associates
| > | www.deanblakely.com
| > | "Steven Cheng[MSFT]" <st*****@online.microsoft.com> wrote in message
| > | news:c4**************@TK2MSFTNGXA02.phx.gbl...
| > | > Thanks for your response Gary,
| > | >
| > | > My answers in line:
| > | >
| > | > I can create a .xsd and TableAdapter for an ASP app in design time.
| > | > However
| > | > vs.net 2005 does not allow me to connect that .xsd to my GridView at
| > | > design
| > | > time (as did vs 2003 allowed me to connect a .xsd to my DataGrid).
So
| > | > because of this weakness I should do the following.....
| > | >
| > | > Create a .xsd in my App_Code folder. Create a class in my App_Code
| > folder
| > | > that returns this dataset. Call this class from my aspx pages.
| > | >
| > | > Is this the best practice???
| > | > =============================================
| > | > Of course we can connect the created TableAdapter/ typed Dataset to
| > the
| > | > DataBound control at design-time, just use the ObjectDatasource
| > control,
| > | > and the steps to do this is:
| > | >
| > | > i) create the DataSet/TableAdatper pairs through wizard....
| > | > ii)drag a ObjectDataSource control onto the page want to use that
| > | > TableAdapter/DataSet to retrieve data....
| > | > iii) configure the ObjectDataSource control to use the TableAdapter
as
| > the
| > | > component class
| > | > iv) connect the databoundcontrol(gridview, detailsview...) to the
| > | > objectdatasource...
| > | >
| > | > Here is the quickstart example which contains bind a
| > tableadapter/dataset
| > | > to asp.net databound control at design-time...:
| > | >
| > | > #ObjectDataSource
| > | >
| >
http://www.asp.net/QuickStart/aspnet...atasource.aspx
| > | >
| > | >
| > | >
| > | >
| > | > now, my rant....
| > | > It seems like vs2005 has taken us backwords. If we follow the MSDN
| > | > articles
| > | > it has us creating DataSources for our gridviews that puts SQL in
our
| > ASPX
| > | > pages (and that is not acceptable). vs2005 has also taken away our
| > | > ability
| > | > to bind to datasets at design time - WHY? do I misunderstand?
| > | > ==============================================
| > | > And the VS2003's approch is actually based on some autogenerated
code
| > | > (inside the initializeComponents function...), this is sometimes a
bit
| > | > hard
| > | > to maintain since it is IDE autogenerated.... While vs 2005 use
the
| > new
| > | > datasource control model which avoid much IDE generated code....
Just
| > put
| > | > datasource control at configure it in page template statically (no
| > much
| > | > code needed....)
| > | >
| > | > Also, though SQLDataSource control need to specify sql statement in
| > aspx
| > | > template, you can choose to precompiled page so that no aspx
content
| > will
| > | > be exposed at deployment time... Also, sqldatasource provide a
rapid
| > data
| > | > access developing approach which is suitable for some simple
| > application
| > | > or
| > | > design prototype.... ObjectDataSource provide the more flexible
and
| > | > advanced means to connect to different data access layer....
| > | >
| > | > 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>
| > | > | References: <ep*************@TK2MSFTNGP09.phx.gbl>
| > | > <PE**************@TK2MSFTNGXA02.phx.gbl>
| > | > | Subject: Re: 2.0 DataSources vs. TableAdapter/Datasets
| > | > | Date: Tue, 3 Jan 2006 10:25:25 -0800
| > | > | Lines: 135
| > | > | 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: <ug**************@tk2msftngp13.phx.gbl>
| > | > | Newsgroups: microsoft.public.dotnet.framework.aspnet
| > | > | NNTP-Posting-Host: user-vcauk40.dsl.mindspring.com 216.175.80.128
| > | > | Path:
| > TK2MSFTNGXA02.phx.gbl!TK2MSFTNGP08.phx.gbl!tk2msft ngp13.phx.gbl
| > | > | Xref: TK2MSFTNGXA02.phx.gbl
| > | > microsoft.public.dotnet.framework.aspnet:368327
| > | > | X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
| > | > |
| > | > | Steven,
| > | > | Please tell me if this is correct...
| > | > |
| > | > | I can create a .xsd and TableAdapter for an ASP app in design
time.
| > | > However
| > | > | vs.net 2005 does not allow me to connect that .xsd to my GridView
at
| > | > design
| > | > | time (as did vs 2003 allowed me to connect a .xsd to my
DataGrid).
| > So
| > | > | because of this weakness I should do the following.....
| > | > |
| > | > | Create a .xsd in my App_Code folder. Create a class in my
App_Code
| > | > folder
| > | > | that returns this dataset. Call this class from my aspx pages.
| > | > |
| > | > | Is this the best practice???
| > | > |
| > | > | now, my rant....
| > | > | It seems like vs2005 has taken us backwords. If we follow the
MSDN
| > | > articles
| > | > | it has us creating DataSources for our gridviews that puts SQL in
| > our
| > | > ASPX
| > | > | pages (and that is not acceptable). vs2005 has also taken away
our
| > | > ability
| > | > | to bind to datasets at design time - WHY? do I misunderstand?
| > | > |
| > | > | --
| > | > | Regards,
| > | > | Gary Blakely
| > | > | "Steven Cheng[MSFT]" <st*****@online.microsoft.com> wrote in
message
| > | > | news:PE**************@TK2MSFTNGXA02.phx.gbl...
| > | > | > Hi Gary,
| > | > | >
| > | > | > Welcome.
| > | > | > As for the TableAdapter's different design mode and behavior in
| > net
| > | > 2.0
| > | > | > winform app and asp.net application ,here are some of my
| > understanding
| > | > and
| > | > | > suggestions:
| > | > | >
| > | > | > For the different design-time support and behavior on using
| > | > TableAdpater
| > | > | > components in winform application and asp.net application, it is
| > due
| > | > to
| > | > | > the
| > | > | > different underlying application nature and programming model.
| > Winform
| > | > | > application is desktop app where all the class instances and
| > componets
| > | > | > live
| > | > | > in the application's memorty space as long as the application
keep
| > | > | > alive...
| > | > | > While for asp.net application, it is request/response based,
| > asp.net
| > | > page
| > | > | > instance only live when a request arrive server and being
| > processed,
| > | > after
| > | > | > request finished, the page object will disposed(also, mulitple
| > page
| > | > | > instances won't have relations to each other.... ) , so we
should
| > not
| > | > use
| > | > | > the same programming model as winform app.
| > | > | >
| > | > | > For sharing component instance or class objects in asp.net
| > | > application,
| > | > we
| > | > | > can use the following means:
| > | > | >
| > | > | > 1. Create the shared component instance and store it in a global
| > wide
| > | > | > storage, e.g the ApplicationState or Application Cache is the
| > | > reasonable
| > | > | > place for storing such component....
| > | > | >
| > | > | > 2. Also, if your applcation always running in a single
appdomain,
| > you
| > | > can
| > | > | > consider using a certain class's public static member property
to
| > hold
| > | > | > such
| > | > | > shared data or resources so that all the pages requests can
| > reference
| > | > | > those
| > | > | > shared objects....
| > | > | >
| > | > | > In addition, ASP.NET appliation in VS.NET can help us create
| > typed
| > | > | > dataset
| > | > | > and a TableAdapter through design surface, however, as I
| > mentioned,
| > | > due
| > | > to
| > | > | > the different programming model, ASP.NET will have limited
support
| > on
| > | > | > using
| > | > | > TableAdpater as winform application at design-time.... but
since
| > | > | > TableAdapter has encapsulated most code, we can just declare
| > certain
| > | > | > vartiables and create the instance to use them.....
| > | > | >
| > | > | > 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 DataSources vs. TableAdapter/Datasets
| > | > | > | Date: Sat, 31 Dec 2005 14:29:31 -0800
| > | > | > | Lines: 25
| > | > | > | 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: <ep*************@TK2MSFTNGP09.phx.gbl>
| > | > | > | Newsgroups: microsoft.public.dotnet.framework.aspnet
| > | > | > | NNTP-Posting-Host: user-vcaur7q.dsl.mindspring.com
| > 216.175.108.250
| > | > | > | Path:
| > | > TK2MSFTNGXA02.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFT NGP09.phx.gbl
| > | > | > | Xref: TK2MSFTNGXA02.phx.gbl
| > | > | > microsoft.public.dotnet.framework.aspnet:367882
| > | > | > | X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
| > | > | > |
| > | > | > | We have been noticing that questions on vs.2005/2.0 don't
appear
| > to
| > | > get
| > | > | > much
| > | > | > | in answers so I'm reposting some questions posted by some of
the
| > | > | > programmers
| > | > | > | here in our organization that never got answered...
| > | > | > |
| > | > | > | There are articles on the new TableAdapters where it says
that a
| > key
| > | > new
| > | > | > | advantage is that a single TableAdapter, which can have
multiple
| > | > | > queries,
| > | > | > | can be used on multiple forms. Now that was in an article on
| > using
| > | > | > | TableAdapters with Forms Apps. There is a DataSource window
| > that
| > | > stores
| > | > | > | common datasources for the whole project (accessed via the
Data
| > menu
| > | > | > item).
| > | > | > |
| > | > | > | Now, back to ASP apps - there is no Data on the menu, no
| > datasource
| > | > | > window,
| > | > | > | and it looks like TableAdapters need to be generated from a
| > | > DataSource
| > | > | > | dropped on a page. Does this mean that aspx pages won't be
able
| > to
| > | > | > share
| > | > | > | TableAdapters?
| > | > | > |
| > | > | > | Also, in Form apps the IDE guids us to create the new 2.0 .XSD
| > | > datasets
| > | > | > that
| > | > | > | have TableAdapters where the ASP IDE guids us to create
| > DataSources
| > | > that
| > | > | > | don't create .XSDs with TableAdapters. Why the difference?
| > | > | > |
| > | > | > |
| > | > | > | --
| > | > | > | Regards,
| > | > | > | Gary Blakely
| > | > | > |
| > | > | > |
| > | > | > |
| > | > | >
| > | > |
| > | > |
| > | > |
| > | >
| > |
| > |
| > |
| >
|
|
|

Jan 9 '06 #8
Steven,
Thanks for your help. that explains it very well.
Gary

--
Regards,
Gary Blakely
Dean Blakely & Associates
www.deanblakely.com
"Steven Cheng[MSFT]" <st*****@online.microsoft.com> wrote in message
news:JY**************@TK2MSFTNGXA02.phx.gbl...
Hi Gary,

the xsd file in the App_Code folder is dynamically compiled into assembly
which contains the DataSet and TableAdapter classes, that's why you do not
find the designer.cs(vb) file as in winform project. To find the
TableAdapter class, just drag the ObjectDataSource and in the
configuration
wizard, when you need to choose the Business Object, check the "show only
data components..."., the TableAdapter will appear in it...

Also, if you just want to view the generated TableAdapter classes , open
the "Class View" through View--->Class View menu item, then in the Class
view, you will find all the currently available classes in the project
which include the TableAdapter and DataSet ....

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>
| References: <ep*************@TK2MSFTNGP09.phx.gbl>
<PE**************@TK2MSFTNGXA02.phx.gbl>
<ug**************@tk2msftngp13.phx.gbl>
<c4**************@TK2MSFTNGXA02.phx.gbl>
<O8**************@TK2MSFTNGP15.phx.gbl>
<S$**************@TK2MSFTNGXA02.phx.gbl>
| Subject: Re: 2.0 DataSources vs. TableAdapter/Datasets
| Date: Fri, 6 Jan 2006 17:33:01 -0800
| Lines: 454
| 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: <uY**************@TK2MSFTNGP12.phx.gbl>
| Newsgroups: microsoft.public.dotnet.framework.aspnet
| NNTP-Posting-Host: 216.244.8.41
| Path: TK2MSFTNGXA02.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFT NGP12.phx.gbl
| Xref: TK2MSFTNGXA02.phx.gbl
microsoft.public.dotnet.framework.aspnet:369161
| X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
|
| I'm having a hare time communicating my problem....
|
| I know that I need to specify the Datasets Class name in the typename
| property. My problem is that I can't find out where that class name is
| specified! there is just a DataSet1.xsd and a DataSet1.xss file and
neither
| of those files have anything such as a class name.
|
| How do I find the class name??????\
|
| (in a forms app I created, I just had to double click the node of the
xsd
| file and a datasetDesigner.vb file got generated but this does not work
in
| my asp app)
|
| Still searching for that magical class name...
| --
| Regards,
| Gary Blakely
| "Steven Cheng[MSFT]" <st*****@online.microsoft.com> wrote in message
| news:S$**************@TK2MSFTNGXA02.phx.gbl...
| > Thanks for your followup Gary,
| >
| > For TypeName, it just let us specify the Data Access Class's class
name,
| > also, as for
| > ==========
| > but there is no information at all on what DataSetTableAdapters is -
| > nothing.
| > ==========
| >
| > this is nothing related with ObjectDataSource or TableAdapter, it is
just
| > a
| > Namespace of the class(TableAdapter...). As we know, in .net
framework,
we
| > can group classes into a given namespace so as to avoid name clash
with
| > other company or studio's component package....
| >
| > So for the VS IDE generated TAbleAdapter/Dataset, they'll be assigned
a
| > namespace, e.g:
| >
| > the following objectdatasource use a TableAdapter which has the
namespace
| > "DataSet1TableAdapters",
| >
| > =======================
| > <asp:ObjectDataSource ID="ObjectDataSource1" runat="server" .........
| > SelectMethod="GetData"
| > TypeName="DataSet1TableAdapters.CategoriesTableAda pter"
| > .........>
| > ======================
| >
| > #namespace
| >
http://msdn.microsoft.com/library/en...ace.asp?frame=
| > true
| >
| > Also, if you're using VS IDE, you can use the design-time smart Tag
wizard
| > to list all the available data accessing components(include
| > TableAdapters )
| > in this project...
| >
| > 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>
| > | References: <ep*************@TK2MSFTNGP09.phx.gbl>
| > <PE**************@TK2MSFTNGXA02.phx.gbl>
| > <ug**************@tk2msftngp13.phx.gbl>
| > <c4**************@TK2MSFTNGXA02.phx.gbl>
| > | Subject: Re: 2.0 DataSources vs. TableAdapter/Datasets
| > | Date: Thu, 5 Jan 2006 18:10:27 -0800
| > | Lines: 310
| > | 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: <O8**************@TK2MSFTNGP15.phx.gbl>
| > | Newsgroups: microsoft.public.dotnet.framework.aspnet
| > | NNTP-Posting-Host: 216.244.8.41
| > | Path:
TK2MSFTNGXA02.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFT NGP15.phx.gbl
| > | Xref: TK2MSFTNGXA02.phx.gbl
| > microsoft.public.dotnet.framework.aspnet:368939
| > | X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
| > |
| > | Steven:
| > | I read the article you provided the hyperlink to with great
interest.
| > After
| > | spending hours pouring over the details in that article and reading
the
| > help
| > | on ObjectDataSource.Typename property I cannot determine what to put
| > into
| > | the ObjectDataSource Typename property. These docs are soooo bad.
| > |
| > | The article you pointed me to has
| > | TypeName="DataSetTableAdapters.PhotosTableAdapter" in the typename
| > property
| > | but there is no information at all on what DataSetTableAdapters is -
| > | nothing.
| > |
| > | I have in my asp project Dataset1.xsd with a dataset named Orders
and
a
| > | TableAdapter named OrdersTableAdapter with methods FillOrders and
| > GetOrders.
| > | None of these names can be used in the Page_Load event as they are
all
| > not
| > | defined.
| > |
| > | If you click on View Source in this article it is using
| > | TypeName="DataComponentTableAdapters.AlbumsTableAd apter" which seems
at
| > odds
| > | with the article.
| > |
| > | The Help file for the Typename property shows
| > | typename="Samples.AspNet.CS.EmployeeLogic" but offers no
explainations
| > of
| > | where that came from or what that means. The help file says that
the
| > | TypeName property Gets or sets the name of the class that the
| > | ObjectDataSource object represents.
| > |
| > | So, I cannot figure out what to put in the typename property - I
can't
| > | figure out what the classname is.
| > |
| > | What should I put in the TypeName property?
| > |
| > | thanks,
| > | Gary
| > |
| > |
| > |
| > |
| > |
| > | --
| > | Regards,
| > | Gary Blakely
| > | Dean Blakely & Associates
| > | www.deanblakely.com
| > | "Steven Cheng[MSFT]" <st*****@online.microsoft.com> wrote in message
| > | news:c4**************@TK2MSFTNGXA02.phx.gbl...
| > | > Thanks for your response Gary,
| > | >
| > | > My answers in line:
| > | >
| > | > I can create a .xsd and TableAdapter for an ASP app in design
time.
| > | > However
| > | > vs.net 2005 does not allow me to connect that .xsd to my GridView
at
| > | > design
| > | > time (as did vs 2003 allowed me to connect a .xsd to my DataGrid).
So
| > | > because of this weakness I should do the following.....
| > | >
| > | > Create a .xsd in my App_Code folder. Create a class in my
App_Code
| > folder
| > | > that returns this dataset. Call this class from my aspx pages.
| > | >
| > | > Is this the best practice???
| > | > =============================================
| > | > Of course we can connect the created TableAdapter/ typed Dataset
to
| > the
| > | > DataBound control at design-time, just use the ObjectDatasource
| > control,
| > | > and the steps to do this is:
| > | >
| > | > i) create the DataSet/TableAdatper pairs through wizard....
| > | > ii)drag a ObjectDataSource control onto the page want to use that
| > | > TableAdapter/DataSet to retrieve data....
| > | > iii) configure the ObjectDataSource control to use the
TableAdapter
as
| > the
| > | > component class
| > | > iv) connect the databoundcontrol(gridview, detailsview...) to the
| > | > objectdatasource...
| > | >
| > | > Here is the quickstart example which contains bind a
| > tableadapter/dataset
| > | > to asp.net databound control at design-time...:
| > | >
| > | > #ObjectDataSource
| > | >
| >
http://www.asp.net/QuickStart/aspnet...atasource.aspx
| > | >
| > | >
| > | >
| > | >
| > | > now, my rant....
| > | > It seems like vs2005 has taken us backwords. If we follow the
MSDN
| > | > articles
| > | > it has us creating DataSources for our gridviews that puts SQL in
our
| > ASPX
| > | > pages (and that is not acceptable). vs2005 has also taken away
our
| > | > ability
| > | > to bind to datasets at design time - WHY? do I misunderstand?
| > | > ==============================================
| > | > And the VS2003's approch is actually based on some autogenerated
code
| > | > (inside the initializeComponents function...), this is sometimes a
bit
| > | > hard
| > | > to maintain since it is IDE autogenerated.... While vs 2005 use
the
| > new
| > | > datasource control model which avoid much IDE generated code....
Just
| > put
| > | > datasource control at configure it in page template statically (no
| > much
| > | > code needed....)
| > | >
| > | > Also, though SQLDataSource control need to specify sql statement
in
| > aspx
| > | > template, you can choose to precompiled page so that no aspx
content
| > will
| > | > be exposed at deployment time... Also, sqldatasource provide a
rapid
| > data
| > | > access developing approach which is suitable for some simple
| > application
| > | > or
| > | > design prototype.... ObjectDataSource provide the more flexible
and
| > | > advanced means to connect to different data access layer....
| > | >
| > | > 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>
| > | > | References: <ep*************@TK2MSFTNGP09.phx.gbl>
| > | > <PE**************@TK2MSFTNGXA02.phx.gbl>
| > | > | Subject: Re: 2.0 DataSources vs. TableAdapter/Datasets
| > | > | Date: Tue, 3 Jan 2006 10:25:25 -0800
| > | > | Lines: 135
| > | > | 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: <ug**************@tk2msftngp13.phx.gbl>
| > | > | Newsgroups: microsoft.public.dotnet.framework.aspnet
| > | > | NNTP-Posting-Host: user-vcauk40.dsl.mindspring.com
216.175.80.128
| > | > | Path:
| > TK2MSFTNGXA02.phx.gbl!TK2MSFTNGP08.phx.gbl!tk2msft ngp13.phx.gbl
| > | > | Xref: TK2MSFTNGXA02.phx.gbl
| > | > microsoft.public.dotnet.framework.aspnet:368327
| > | > | X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
| > | > |
| > | > | Steven,
| > | > | Please tell me if this is correct...
| > | > |
| > | > | I can create a .xsd and TableAdapter for an ASP app in design
time.
| > | > However
| > | > | vs.net 2005 does not allow me to connect that .xsd to my
GridView
at
| > | > design
| > | > | time (as did vs 2003 allowed me to connect a .xsd to my
DataGrid).
| > So
| > | > | because of this weakness I should do the following.....
| > | > |
| > | > | Create a .xsd in my App_Code folder. Create a class in my
App_Code
| > | > folder
| > | > | that returns this dataset. Call this class from my aspx pages.
| > | > |
| > | > | Is this the best practice???
| > | > |
| > | > | now, my rant....
| > | > | It seems like vs2005 has taken us backwords. If we follow the
MSDN
| > | > articles
| > | > | it has us creating DataSources for our gridviews that puts SQL
in
| > our
| > | > ASPX
| > | > | pages (and that is not acceptable). vs2005 has also taken away
our
| > | > ability
| > | > | to bind to datasets at design time - WHY? do I misunderstand?
| > | > |
| > | > | --
| > | > | Regards,
| > | > | Gary Blakely
| > | > | "Steven Cheng[MSFT]" <st*****@online.microsoft.com> wrote in
message
| > | > | news:PE**************@TK2MSFTNGXA02.phx.gbl...
| > | > | > Hi Gary,
| > | > | >
| > | > | > Welcome.
| > | > | > As for the TableAdapter's different design mode and behavior
in
| > net
| > | > 2.0
| > | > | > winform app and asp.net application ,here are some of my
| > understanding
| > | > and
| > | > | > suggestions:
| > | > | >
| > | > | > For the different design-time support and behavior on using
| > | > TableAdpater
| > | > | > components in winform application and asp.net application, it
is
| > due
| > | > to
| > | > | > the
| > | > | > different underlying application nature and programming model.
| > Winform
| > | > | > application is desktop app where all the class instances and
| > componets
| > | > | > live
| > | > | > in the application's memorty space as long as the application
keep
| > | > | > alive...
| > | > | > While for asp.net application, it is request/response based,
| > asp.net
| > | > page
| > | > | > instance only live when a request arrive server and being
| > processed,
| > | > after
| > | > | > request finished, the page object will disposed(also, mulitple
| > page
| > | > | > instances won't have relations to each other.... ) , so we
should
| > not
| > | > use
| > | > | > the same programming model as winform app.
| > | > | >
| > | > | > For sharing component instance or class objects in asp.net
| > | > application,
| > | > we
| > | > | > can use the following means:
| > | > | >
| > | > | > 1. Create the shared component instance and store it in a
global
| > wide
| > | > | > storage, e.g the ApplicationState or Application Cache is the
| > | > reasonable
| > | > | > place for storing such component....
| > | > | >
| > | > | > 2. Also, if your applcation always running in a single
appdomain,
| > you
| > | > can
| > | > | > consider using a certain class's public static member property
to
| > hold
| > | > | > such
| > | > | > shared data or resources so that all the pages requests can
| > reference
| > | > | > those
| > | > | > shared objects....
| > | > | >
| > | > | > In addition, ASP.NET appliation in VS.NET can help us create
| > typed
| > | > | > dataset
| > | > | > and a TableAdapter through design surface, however, as I
| > mentioned,
| > | > due
| > | > to
| > | > | > the different programming model, ASP.NET will have limited
support
| > on
| > | > | > using
| > | > | > TableAdpater as winform application at design-time.... but
since
| > | > | > TableAdapter has encapsulated most code, we can just declare
| > certain
| > | > | > vartiables and create the instance to use them.....
| > | > | >
| > | > | > 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 DataSources vs. TableAdapter/Datasets
| > | > | > | Date: Sat, 31 Dec 2005 14:29:31 -0800
| > | > | > | Lines: 25
| > | > | > | 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: <ep*************@TK2MSFTNGP09.phx.gbl>
| > | > | > | Newsgroups: microsoft.public.dotnet.framework.aspnet
| > | > | > | NNTP-Posting-Host: user-vcaur7q.dsl.mindspring.com
| > 216.175.108.250
| > | > | > | Path:
| > | > TK2MSFTNGXA02.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFT NGP09.phx.gbl
| > | > | > | Xref: TK2MSFTNGXA02.phx.gbl
| > | > | > microsoft.public.dotnet.framework.aspnet:367882
| > | > | > | X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
| > | > | > |
| > | > | > | We have been noticing that questions on vs.2005/2.0 don't
appear
| > to
| > | > get
| > | > | > much
| > | > | > | in answers so I'm reposting some questions posted by some of
the
| > | > | > programmers
| > | > | > | here in our organization that never got answered...
| > | > | > |
| > | > | > | There are articles on the new TableAdapters where it says
that a
| > key
| > | > new
| > | > | > | advantage is that a single TableAdapter, which can have
multiple
| > | > | > queries,
| > | > | > | can be used on multiple forms. Now that was in an article
on
| > using
| > | > | > | TableAdapters with Forms Apps. There is a DataSource window
| > that
| > | > stores
| > | > | > | common datasources for the whole project (accessed via the
Data
| > menu
| > | > | > item).
| > | > | > |
| > | > | > | Now, back to ASP apps - there is no Data on the menu, no
| > datasource
| > | > | > window,
| > | > | > | and it looks like TableAdapters need to be generated from a
| > | > DataSource
| > | > | > | dropped on a page. Does this mean that aspx pages won't be
able
| > to
| > | > | > share
| > | > | > | TableAdapters?
| > | > | > |
| > | > | > | Also, in Form apps the IDE guids us to create the new 2.0
.XSD
| > | > datasets
| > | > | > that
| > | > | > | have TableAdapters where the ASP IDE guids us to create
| > DataSources
| > | > that
| > | > | > | don't create .XSDs with TableAdapters. Why the difference?
| > | > | > |
| > | > | > |
| > | > | > | --
| > | > | > | Regards,
| > | > | > | Gary Blakely
| > | > | > |
| > | > | > |
| > | > | > |
| > | > | >
| > | > |
| > | > |
| > | > |
| > | >
| > |
| > |
| > |
| >
|
|
|

Jan 9 '06 #9
You're welcome Gary,

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: <ep*************@TK2MSFTNGP09.phx.gbl>
<PE**************@TK2MSFTNGXA02.phx.gbl>
<ug**************@tk2msftngp13.phx.gbl>
<c4**************@TK2MSFTNGXA02.phx.gbl>
<O8**************@TK2MSFTNGP15.phx.gbl>
<S$**************@TK2MSFTNGXA02.phx.gbl>
<uY**************@TK2MSFTNGP12.phx.gbl>
<JY**************@TK2MSFTNGXA02.phx.gbl>
| Subject: Re: 2.0 DataSources vs. TableAdapter/Datasets
| Date: Mon, 9 Jan 2006 09:40:16 -0800
| Lines: 589
| 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: <#g**************@tk2msftngp13.phx.gbl>
| Newsgroups: microsoft.public.dotnet.framework.aspnet
| NNTP-Posting-Host: 216.244.8.41
| Path: TK2MSFTNGXA02.phx.gbl!TK2MSFTNGP08.phx.gbl!tk2msft ngp13.phx.gbl
| Xref: TK2MSFTNGXA02.phx.gbl
microsoft.public.dotnet.framework.aspnet:369550
| X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
|
| Steven,
| Thanks for your help. that explains it very well.
| Gary
|
| --
| Regards,
| Gary Blakely
| Dean Blakely & Associates
| www.deanblakely.com
| "Steven Cheng[MSFT]" <st*****@online.microsoft.com> wrote in message
| news:JY**************@TK2MSFTNGXA02.phx.gbl...
| > Hi Gary,
| >
| > the xsd file in the App_Code folder is dynamically compiled into
assembly
| > which contains the DataSet and TableAdapter classes, that's why you do
not
| > find the designer.cs(vb) file as in winform project. To find the
| > TableAdapter class, just drag the ObjectDataSource and in the
| > configuration
| > wizard, when you need to choose the Business Object, check the "show
only
| > data components..."., the TableAdapter will appear in it...
| >
| > Also, if you just want to view the generated TableAdapter classes , open
| > the "Class View" through View--->Class View menu item, then in the
Class
| > view, you will find all the currently available classes in the project
| > which include the TableAdapter and DataSet ....
| >
| > 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>
| > | References: <ep*************@TK2MSFTNGP09.phx.gbl>
| > <PE**************@TK2MSFTNGXA02.phx.gbl>
| > <ug**************@tk2msftngp13.phx.gbl>
| > <c4**************@TK2MSFTNGXA02.phx.gbl>
| > <O8**************@TK2MSFTNGP15.phx.gbl>
| > <S$**************@TK2MSFTNGXA02.phx.gbl>
| > | Subject: Re: 2.0 DataSources vs. TableAdapter/Datasets
| > | Date: Fri, 6 Jan 2006 17:33:01 -0800
| > | Lines: 454
| > | 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: <uY**************@TK2MSFTNGP12.phx.gbl>
| > | Newsgroups: microsoft.public.dotnet.framework.aspnet
| > | NNTP-Posting-Host: 216.244.8.41
| > | Path: TK2MSFTNGXA02.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFT NGP12.phx.gbl
| > | Xref: TK2MSFTNGXA02.phx.gbl
| > microsoft.public.dotnet.framework.aspnet:369161
| > | X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
| > |
| > | I'm having a hare time communicating my problem....
| > |
| > | I know that I need to specify the Datasets Class name in the typename
| > | property. My problem is that I can't find out where that class name
is
| > | specified! there is just a DataSet1.xsd and a DataSet1.xss file and
| > neither
| > | of those files have anything such as a class name.
| > |
| > | How do I find the class name??????\
| > |
| > | (in a forms app I created, I just had to double click the node of the
| > xsd
| > | file and a datasetDesigner.vb file got generated but this does not
work
| > in
| > | my asp app)
| > |
| > | Still searching for that magical class name...
| > | --
| > | Regards,
| > | Gary Blakely
| > | "Steven Cheng[MSFT]" <st*****@online.microsoft.com> wrote in message
| > | news:S$**************@TK2MSFTNGXA02.phx.gbl...
| > | > Thanks for your followup Gary,
| > | >
| > | > For TypeName, it just let us specify the Data Access Class's class
| > name,
| > | > also, as for
| > | > ==========
| > | > but there is no information at all on what DataSetTableAdapters is -
| > | > nothing.
| > | > ==========
| > | >
| > | > this is nothing related with ObjectDataSource or TableAdapter, it is
| > just
| > | > a
| > | > Namespace of the class(TableAdapter...). As we know, in .net
| > framework,
| > we
| > | > can group classes into a given namespace so as to avoid name clash
| > with
| > | > other company or studio's component package....
| > | >
| > | > So for the VS IDE generated TAbleAdapter/Dataset, they'll be
assigned
| > a
| > | > namespace, e.g:
| > | >
| > | > the following objectdatasource use a TableAdapter which has the
| > namespace
| > | > "DataSet1TableAdapters",
| > | >
| > | > =======================
| > | > <asp:ObjectDataSource ID="ObjectDataSource1" runat="server"
.........
| > | > SelectMethod="GetData"
| > | > TypeName="DataSet1TableAdapters.CategoriesTableAda pter"
| > | > .........>
| > | > ======================
| > | >
| > | > #namespace
| > | >
| >
http://msdn.microsoft.com/library/en...ace.asp?frame=
| > | > true
| > | >
| > | > Also, if you're using VS IDE, you can use the design-time smart Tag
| > wizard
| > | > to list all the available data accessing components(include
| > | > TableAdapters )
| > | > in this project...
| > | >
| > | > 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>
| > | > | References: <ep*************@TK2MSFTNGP09.phx.gbl>
| > | > <PE**************@TK2MSFTNGXA02.phx.gbl>
| > | > <ug**************@tk2msftngp13.phx.gbl>
| > | > <c4**************@TK2MSFTNGXA02.phx.gbl>
| > | > | Subject: Re: 2.0 DataSources vs. TableAdapter/Datasets
| > | > | Date: Thu, 5 Jan 2006 18:10:27 -0800
| > | > | Lines: 310
| > | > | 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: <O8**************@TK2MSFTNGP15.phx.gbl>
| > | > | Newsgroups: microsoft.public.dotnet.framework.aspnet
| > | > | NNTP-Posting-Host: 216.244.8.41
| > | > | Path:
| > TK2MSFTNGXA02.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFT NGP15.phx.gbl
| > | > | Xref: TK2MSFTNGXA02.phx.gbl
| > | > microsoft.public.dotnet.framework.aspnet:368939
| > | > | X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
| > | > |
| > | > | Steven:
| > | > | I read the article you provided the hyperlink to with great
| > interest.
| > | > After
| > | > | spending hours pouring over the details in that article and
reading
| > the
| > | > help
| > | > | on ObjectDataSource.Typename property I cannot determine what to
put
| > | > into
| > | > | the ObjectDataSource Typename property. These docs are soooo bad.
| > | > |
| > | > | The article you pointed me to has
| > | > | TypeName="DataSetTableAdapters.PhotosTableAdapter" in the typename
| > | > property
| > | > | but there is no information at all on what DataSetTableAdapters
is -
| > | > | nothing.
| > | > |
| > | > | I have in my asp project Dataset1.xsd with a dataset named Orders
| > and
| > a
| > | > | TableAdapter named OrdersTableAdapter with methods FillOrders and
| > | > GetOrders.
| > | > | None of these names can be used in the Page_Load event as they
are
| > all
| > | > not
| > | > | defined.
| > | > |
| > | > | If you click on View Source in this article it is using
| > | > | TypeName="DataComponentTableAdapters.AlbumsTableAd apter" which
seems
| > at
| > | > odds
| > | > | with the article.
| > | > |
| > | > | The Help file for the Typename property shows
| > | > | typename="Samples.AspNet.CS.EmployeeLogic" but offers no
| > explainations
| > | > of
| > | > | where that came from or what that means. The help file says that
| > the
| > | > | TypeName property Gets or sets the name of the class that the
| > | > | ObjectDataSource object represents.
| > | > |
| > | > | So, I cannot figure out what to put in the typename property - I
| > can't
| > | > | figure out what the classname is.
| > | > |
| > | > | What should I put in the TypeName property?
| > | > |
| > | > | thanks,
| > | > | Gary
| > | > |
| > | > |
| > | > |
| > | > |
| > | > |
| > | > | --
| > | > | Regards,
| > | > | Gary Blakely
| > | > | Dean Blakely & Associates
| > | > | www.deanblakely.com
| > | > | "Steven Cheng[MSFT]" <st*****@online.microsoft.com> wrote in
message
| > | > | news:c4**************@TK2MSFTNGXA02.phx.gbl...
| > | > | > Thanks for your response Gary,
| > | > | >
| > | > | > My answers in line:
| > | > | >
| > | > | > I can create a .xsd and TableAdapter for an ASP app in design
| > time.
| > | > | > However
| > | > | > vs.net 2005 does not allow me to connect that .xsd to my
GridView
| > at
| > | > | > design
| > | > | > time (as did vs 2003 allowed me to connect a .xsd to my
DataGrid).
| > So
| > | > | > because of this weakness I should do the following.....
| > | > | >
| > | > | > Create a .xsd in my App_Code folder. Create a class in my
| > App_Code
| > | > folder
| > | > | > that returns this dataset. Call this class from my aspx pages.
| > | > | >
| > | > | > Is this the best practice???
| > | > | > =============================================
| > | > | > Of course we can connect the created TableAdapter/ typed
Dataset
| > to
| > | > the
| > | > | > DataBound control at design-time, just use the ObjectDatasource
| > | > control,
| > | > | > and the steps to do this is:
| > | > | >
| > | > | > i) create the DataSet/TableAdatper pairs through wizard....
| > | > | > ii)drag a ObjectDataSource control onto the page want to use
that
| > | > | > TableAdapter/DataSet to retrieve data....
| > | > | > iii) configure the ObjectDataSource control to use the
| > TableAdapter
| > as
| > | > the
| > | > | > component class
| > | > | > iv) connect the databoundcontrol(gridview, detailsview...) to
the
| > | > | > objectdatasource...
| > | > | >
| > | > | > Here is the quickstart example which contains bind a
| > | > tableadapter/dataset
| > | > | > to asp.net databound control at design-time...:
| > | > | >
| > | > | > #ObjectDataSource
| > | > | >
| > | >
| >
http://www.asp.net/QuickStart/aspnet...atasource.aspx
| > | > | >
| > | > | >
| > | > | >
| > | > | >
| > | > | > now, my rant....
| > | > | > It seems like vs2005 has taken us backwords. If we follow the
| > MSDN
| > | > | > articles
| > | > | > it has us creating DataSources for our gridviews that puts SQL
in
| > our
| > | > ASPX
| > | > | > pages (and that is not acceptable). vs2005 has also taken away
| > our
| > | > | > ability
| > | > | > to bind to datasets at design time - WHY? do I misunderstand?
| > | > | > ==============================================
| > | > | > And the VS2003's approch is actually based on some autogenerated
| > code
| > | > | > (inside the initializeComponents function...), this is
sometimes a
| > bit
| > | > | > hard
| > | > | > to maintain since it is IDE autogenerated.... While vs 2005
use
| > the
| > | > new
| > | > | > datasource control model which avoid much IDE generated code....
| > Just
| > | > put
| > | > | > datasource control at configure it in page template statically
(no
| > | > much
| > | > | > code needed....)
| > | > | >
| > | > | > Also, though SQLDataSource control need to specify sql
statement
| > in
| > | > aspx
| > | > | > template, you can choose to precompiled page so that no aspx
| > content
| > | > will
| > | > | > be exposed at deployment time... Also, sqldatasource provide a
| > rapid
| > | > data
| > | > | > access developing approach which is suitable for some simple
| > | > application
| > | > | > or
| > | > | > design prototype.... ObjectDataSource provide the more
flexible
| > and
| > | > | > advanced means to connect to different data access layer....
| > | > | >
| > | > | > 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>
| > | > | > | References: <ep*************@TK2MSFTNGP09.phx.gbl>
| > | > | > <PE**************@TK2MSFTNGXA02.phx.gbl>
| > | > | > | Subject: Re: 2.0 DataSources vs. TableAdapter/Datasets
| > | > | > | Date: Tue, 3 Jan 2006 10:25:25 -0800
| > | > | > | Lines: 135
| > | > | > | 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: <ug**************@tk2msftngp13.phx.gbl>
| > | > | > | Newsgroups: microsoft.public.dotnet.framework.aspnet
| > | > | > | NNTP-Posting-Host: user-vcauk40.dsl.mindspring.com
| > 216.175.80.128
| > | > | > | Path:
| > | > TK2MSFTNGXA02.phx.gbl!TK2MSFTNGP08.phx.gbl!tk2msft ngp13.phx.gbl
| > | > | > | Xref: TK2MSFTNGXA02.phx.gbl
| > | > | > microsoft.public.dotnet.framework.aspnet:368327
| > | > | > | X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
| > | > | > |
| > | > | > | Steven,
| > | > | > | Please tell me if this is correct...
| > | > | > |
| > | > | > | I can create a .xsd and TableAdapter for an ASP app in design
| > time.
| > | > | > However
| > | > | > | vs.net 2005 does not allow me to connect that .xsd to my
| > GridView
| > at
| > | > | > design
| > | > | > | time (as did vs 2003 allowed me to connect a .xsd to my
| > DataGrid).
| > | > So
| > | > | > | because of this weakness I should do the following.....
| > | > | > |
| > | > | > | Create a .xsd in my App_Code folder. Create a class in my
| > App_Code
| > | > | > folder
| > | > | > | that returns this dataset. Call this class from my aspx
pages.
| > | > | > |
| > | > | > | Is this the best practice???
| > | > | > |
| > | > | > | now, my rant....
| > | > | > | It seems like vs2005 has taken us backwords. If we follow the
| > MSDN
| > | > | > articles
| > | > | > | it has us creating DataSources for our gridviews that puts
SQL
| > in
| > | > our
| > | > | > ASPX
| > | > | > | pages (and that is not acceptable). vs2005 has also taken
away
| > our
| > | > | > ability
| > | > | > | to bind to datasets at design time - WHY? do I misunderstand?
| > | > | > |
| > | > | > | --
| > | > | > | Regards,
| > | > | > | Gary Blakely
| > | > | > | "Steven Cheng[MSFT]" <st*****@online.microsoft.com> wrote in
| > message
| > | > | > | news:PE**************@TK2MSFTNGXA02.phx.gbl...
| > | > | > | > Hi Gary,
| > | > | > | >
| > | > | > | > Welcome.
| > | > | > | > As for the TableAdapter's different design mode and
behavior
| > in
| > | > net
| > | > | > 2.0
| > | > | > | > winform app and asp.net application ,here are some of my
| > | > understanding
| > | > | > and
| > | > | > | > suggestions:
| > | > | > | >
| > | > | > | > For the different design-time support and behavior on using
| > | > | > TableAdpater
| > | > | > | > components in winform application and asp.net application,
it
| > is
| > | > due
| > | > | > to
| > | > | > | > the
| > | > | > | > different underlying application nature and programming
model.
| > | > Winform
| > | > | > | > application is desktop app where all the class instances and
| > | > componets
| > | > | > | > live
| > | > | > | > in the application's memorty space as long as the
application
| > keep
| > | > | > | > alive...
| > | > | > | > While for asp.net application, it is request/response based,
| > | > asp.net
| > | > | > page
| > | > | > | > instance only live when a request arrive server and being
| > | > processed,
| > | > | > after
| > | > | > | > request finished, the page object will disposed(also,
mulitple
| > | > page
| > | > | > | > instances won't have relations to each other.... ) , so we
| > should
| > | > not
| > | > | > use
| > | > | > | > the same programming model as winform app.
| > | > | > | >
| > | > | > | > For sharing component instance or class objects in asp.net
| > | > | > application,
| > | > | > we
| > | > | > | > can use the following means:
| > | > | > | >
| > | > | > | > 1. Create the shared component instance and store it in a
| > global
| > | > wide
| > | > | > | > storage, e.g the ApplicationState or Application Cache is
the
| > | > | > reasonable
| > | > | > | > place for storing such component....
| > | > | > | >
| > | > | > | > 2. Also, if your applcation always running in a single
| > appdomain,
| > | > you
| > | > | > can
| > | > | > | > consider using a certain class's public static member
property
| > to
| > | > hold
| > | > | > | > such
| > | > | > | > shared data or resources so that all the pages requests can
| > | > reference
| > | > | > | > those
| > | > | > | > shared objects....
| > | > | > | >
| > | > | > | > In addition, ASP.NET appliation in VS.NET can help us
create
| > | > typed
| > | > | > | > dataset
| > | > | > | > and a TableAdapter through design surface, however, as I
| > | > mentioned,
| > | > | > due
| > | > | > to
| > | > | > | > the different programming model, ASP.NET will have limited
| > support
| > | > on
| > | > | > | > using
| > | > | > | > TableAdpater as winform application at design-time.... but
| > since
| > | > | > | > TableAdapter has encapsulated most code, we can just declare
| > | > certain
| > | > | > | > vartiables and create the instance to use them.....
| > | > | > | >
| > | > | > | > 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 DataSources vs. TableAdapter/Datasets
| > | > | > | > | Date: Sat, 31 Dec 2005 14:29:31 -0800
| > | > | > | > | Lines: 25
| > | > | > | > | 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: <ep*************@TK2MSFTNGP09.phx.gbl>
| > | > | > | > | Newsgroups: microsoft.public.dotnet.framework.aspnet
| > | > | > | > | NNTP-Posting-Host: user-vcaur7q.dsl.mindspring.com
| > | > 216.175.108.250
| > | > | > | > | Path:
| > | > | > TK2MSFTNGXA02.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFT NGP09.phx.gbl
| > | > | > | > | Xref: TK2MSFTNGXA02.phx.gbl
| > | > | > | > microsoft.public.dotnet.framework.aspnet:367882
| > | > | > | > | X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
| > | > | > | > |
| > | > | > | > | We have been noticing that questions on vs.2005/2.0 don't
| > appear
| > | > to
| > | > | > get
| > | > | > | > much
| > | > | > | > | in answers so I'm reposting some questions posted by some
of
| > the
| > | > | > | > programmers
| > | > | > | > | here in our organization that never got answered...
| > | > | > | > |
| > | > | > | > | There are articles on the new TableAdapters where it says
| > that a
| > | > key
| > | > | > new
| > | > | > | > | advantage is that a single TableAdapter, which can have
| > multiple
| > | > | > | > queries,
| > | > | > | > | can be used on multiple forms. Now that was in an
article
| > on
| > | > using
| > | > | > | > | TableAdapters with Forms Apps. There is a DataSource
window
| > | > that
| > | > | > stores
| > | > | > | > | common datasources for the whole project (accessed via the
| > Data
| > | > menu
| > | > | > | > item).
| > | > | > | > |
| > | > | > | > | Now, back to ASP apps - there is no Data on the menu, no
| > | > datasource
| > | > | > | > window,
| > | > | > | > | and it looks like TableAdapters need to be generated from
a
| > | > | > DataSource
| > | > | > | > | dropped on a page. Does this mean that aspx pages won't
be
| > able
| > | > to
| > | > | > | > share
| > | > | > | > | TableAdapters?
| > | > | > | > |
| > | > | > | > | Also, in Form apps the IDE guids us to create the new 2.0
| > .XSD
| > | > | > datasets
| > | > | > | > that
| > | > | > | > | have TableAdapters where the ASP IDE guids us to create
| > | > DataSources
| > | > | > that
| > | > | > | > | don't create .XSDs with TableAdapters. Why the
difference?
| > | > | > | > |
| > | > | > | > |
| > | > | > | > | --
| > | > | > | > | Regards,
| > | > | > | > | Gary Blakely
| > | > | > | > |
| > | > | > | > |
| > | > | > | > |
| > | > | > | >
| > | > | > |
| > | > | > |
| > | > | > |
| > | > | >
| > | > |
| > | > |
| > | > |
| > | >
| > |
| > |
| > |
| >
|
|
|

Jan 10 '06 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Tina | last post by:
I'm reading articles on the new TableAdapters where it says that a key new advantage is that a single TableAdapter, which can have multiple queries, can be used on multiple forms. Now that was in...
5
by: Programatix | last post by:
Hi, Have anyone ever benchmark the TableAdapter performance compared to DataTable's Load method? I found out that the DataTable's Load method is about 10x faster than TableAdapter's Fill method....
9
by: T. Wong | last post by:
If I create a datasource after dragging a GridView onto an aspx page it puts my sql in the .aspx file. SQL in the aspx file is just wrong - it's like going back to asp where we had code and sql in...
8
by: Joey Chömpff | last post by:
L.S., Hello is there a way to implement 2-way databinding without using the datasources from dotnet 2.0. Why would you ask? Now that's simple. I've created an object model with BusinessObjects...
1
by: Demetri | last post by:
I have a question / concern regarding the new suggested way of creating a data access layer in an n-tier application. Typically, a web application specifically, using the SOA (Service Oriented...
1
by: Magnus | last post by:
I have a set of typed datasets that are tied to a database on a mssql2005 server. They are naturally displayed and available in the DataSources window. Now I want to rename the database, but when I...
19
by: cpnet | last post by:
I'm using VS2005, C#, ASP.NET 2.0. I'm trying to create a report using SQL Reporting Services (to be used in local mode so I don't have to deal with SQL Server). When I create a new report in my...
4
by: Steve Marshall | last post by:
I have come across the situation several times where a number of forms in an app use the same datasource, for example to populate a combo drop-down. I'm sure we've all had this. Using the IDE...
3
by: =?Utf-8?B?UmljaCBIdXRjaGlucw==?= | last post by:
I'm not really sure how to ask this question because I'm still getting my feet wet with data access and VB.NET, but here goes: To start off with, I'm using VB 2005 Express to connect to an Access...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.