By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
448,967 Members | 1,581 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 448,967 IT Pros & Developers. It's quick & easy.

2.0 DataSources vs. TableAdapter/Datasets

P: n/a
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
Share this Question
Share on Google+
9 Replies


P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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 discussion thread is closed

Replies have been disabled for this discussion.