473,396 Members | 1,838 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

Data layer experts - Please Help!

Hi folks

Can anyone point me in the direction of any information on how to make a
data layer which will work with the new ASP.NET 2.0 data components
(GridView, etc)?

The reason I ask is because I want to have my data layer in a totally
separate assembly. However, this doesn't seem possible. Let me explain....

Every site which describes how to do this seems to follow the same pattern -
half the site talks about how data layers are great, etc. Then, when it
comes to an example, they drop an SQLDataSource or an ObjectDataSource
directly on the page. Am I missing something here - to me this isn't a data
layer.

Also, when you create a DataSet in an ASP.NET application, you get different
methods to that of a DataSet in a normal assembly. In fact, in an ASP.NET
DataSet you don't even get any C# code which means that you can't use it in
normal code (so you can't create a wrapper around it). It also means that
ASP.NET components won't work with an assembly DataSet (since it doesn't
generate Insert and Delete methods) - it only generates "GetData" and
"Update".

I think I am missing some chunk of information so would be great if you
could help!

Thanks

Will
Mar 10 '06 #1
10 1229
Yes, all the drag and drop designer stuff is not practical or usable when
you are designing a flexible architecture that you want to abstract.

If you want it done right, you need to do it all yourself without having the
designer do it all for you. Write your insert/update/delete/select
statements yourself, etc.

"William Buchanan" <wi**************@freenet.co.uk> wrote in message
news:e1**************@TK2MSFTNGP11.phx.gbl...
Hi folks

Can anyone point me in the direction of any information on how to make a
data layer which will work with the new ASP.NET 2.0 data components
(GridView, etc)?

The reason I ask is because I want to have my data layer in a totally
separate assembly. However, this doesn't seem possible. Let me explain....

Every site which describes how to do this seems to follow the same
pattern - half the site talks about how data layers are great, etc. Then,
when it comes to an example, they drop an SQLDataSource or an
ObjectDataSource directly on the page. Am I missing something here - to me
this isn't a data layer.

Also, when you create a DataSet in an ASP.NET application, you get
different methods to that of a DataSet in a normal assembly. In fact, in
an ASP.NET DataSet you don't even get any C# code which means that you
can't use it in normal code (so you can't create a wrapper around it). It
also means that ASP.NET components won't work with an assembly DataSet
(since it doesn't generate Insert and Delete methods) - it only generates
"GetData" and "Update".

I think I am missing some chunk of information so would be great if you
could help!

Thanks

Will

Mar 10 '06 #2
read about how to interface your data layer with ObjectDataSource. The
design of the ObjectDataSource was to be used with custom data layers.

-- bruce (sqlwork.com)


"William Buchanan" <wi**************@freenet.co.uk> wrote in message
news:e1**************@TK2MSFTNGP11.phx.gbl...
Hi folks

Can anyone point me in the direction of any information on how to make a
data layer which will work with the new ASP.NET 2.0 data components
(GridView, etc)?

The reason I ask is because I want to have my data layer in a totally
separate assembly. However, this doesn't seem possible. Let me explain....

Every site which describes how to do this seems to follow the same
pattern - half the site talks about how data layers are great, etc. Then,
when it comes to an example, they drop an SQLDataSource or an
ObjectDataSource directly on the page. Am I missing something here - to me
this isn't a data layer.

Also, when you create a DataSet in an ASP.NET application, you get
different methods to that of a DataSet in a normal assembly. In fact, in
an ASP.NET DataSet you don't even get any C# code which means that you
can't use it in normal code (so you can't create a wrapper around it). It
also means that ASP.NET components won't work with an assembly DataSet
(since it doesn't generate Insert and Delete methods) - it only generates
"GetData" and "Update".

I think I am missing some chunk of information so would be great if you
could help!

Thanks

Will

Mar 10 '06 #3
Yes ObjectDataSource is designed for multi-layers.

"Bruce Barker" wrote:
read about how to interface your data layer with ObjectDataSource. The
design of the ObjectDataSource was to be used with custom data layers.

-- bruce (sqlwork.com)


"William Buchanan" <wi**************@freenet.co.uk> wrote in message
news:e1**************@TK2MSFTNGP11.phx.gbl...
Hi folks

Can anyone point me in the direction of any information on how to make a
data layer which will work with the new ASP.NET 2.0 data components
(GridView, etc)?

The reason I ask is because I want to have my data layer in a totally
separate assembly. However, this doesn't seem possible. Let me explain....

Every site which describes how to do this seems to follow the same
pattern - half the site talks about how data layers are great, etc. Then,
when it comes to an example, they drop an SQLDataSource or an
ObjectDataSource directly on the page. Am I missing something here - to me
this isn't a data layer.

Also, when you create a DataSet in an ASP.NET application, you get
different methods to that of a DataSet in a normal assembly. In fact, in
an ASP.NET DataSet you don't even get any C# code which means that you
can't use it in normal code (so you can't create a wrapper around it). It
also means that ASP.NET components won't work with an assembly DataSet
(since it doesn't generate Insert and Delete methods) - it only generates
"GetData" and "Update".

I think I am missing some chunk of information so would be great if you
could help!

Thanks

Will


Mar 10 '06 #4

Those new things are developed for "Rapid Development"...not necessarily
"well designed tiered development".

You want to the use the alternate ObjectDataSource instead.

The way I've been doing it, (but I'm not expert, and still learning 2.0) is
that I
call the business object which returns a Collection usually (my own
implemented CollectionBase)
and then I bind the ObjectDataSource1 (because its dragged on the page) to
the MyCollection.
Then the Grid is bound to the ObjectDataSource1.

I consider MyCollection as the model, and the ObjectDataSource1 is just a
helper to get it wired up to the GridView nicely.

...


"William Buchanan" <wi**************@freenet.co.uk> wrote in message
news:e1**************@TK2MSFTNGP11.phx.gbl...
Hi folks

Can anyone point me in the direction of any information on how to make a
data layer which will work with the new ASP.NET 2.0 data components
(GridView, etc)?

The reason I ask is because I want to have my data layer in a totally
separate assembly. However, this doesn't seem possible. Let me explain....

Every site which describes how to do this seems to follow the same pattern - half the site talks about how data layers are great, etc. Then, when it
comes to an example, they drop an SQLDataSource or an ObjectDataSource
directly on the page. Am I missing something here - to me this isn't a data layer.

Also, when you create a DataSet in an ASP.NET application, you get different methods to that of a DataSet in a normal assembly. In fact, in an ASP.NET
DataSet you don't even get any C# code which means that you can't use it in normal code (so you can't create a wrapper around it). It also means that
ASP.NET components won't work with an assembly DataSet (since it doesn't
generate Insert and Delete methods) - it only generates "GetData" and
"Update".

I think I am missing some chunk of information so would be great if you
could help!

Thanks

Will

Mar 10 '06 #5
Thanks for the reply. I'm not going mad then!

How would you recommend I read/write to the database? In the past i've used
DataAdapter, SQLCommand, etc, but they have been hidden to persuade us to
use the new components - this has led me to believe that there is an
alternative way of doing this kind of work, although I haven't found it yet.

Thanks for your time.

Will

"Marina Levit [MVP]" <so*****@nospam.com> wrote in message
news:Ol**************@TK2MSFTNGP09.phx.gbl...
Yes, all the drag and drop designer stuff is not practical or usable when
you are designing a flexible architecture that you want to abstract.

If you want it done right, you need to do it all yourself without having
the designer do it all for you. Write your insert/update/delete/select
statements yourself, etc.

"William Buchanan" <wi**************@freenet.co.uk> wrote in message
news:e1**************@TK2MSFTNGP11.phx.gbl...
Hi folks

Can anyone point me in the direction of any information on how to make a
data layer which will work with the new ASP.NET 2.0 data components
(GridView, etc)?

The reason I ask is because I want to have my data layer in a totally
separate assembly. However, this doesn't seem possible. Let me
explain....

Every site which describes how to do this seems to follow the same
pattern - half the site talks about how data layers are great, etc. Then,
when it comes to an example, they drop an SQLDataSource or an
ObjectDataSource directly on the page. Am I missing something here - to
me this isn't a data layer.

Also, when you create a DataSet in an ASP.NET application, you get
different methods to that of a DataSet in a normal assembly. In fact, in
an ASP.NET DataSet you don't even get any C# code which means that you
can't use it in normal code (so you can't create a wrapper around it). It
also means that ASP.NET components won't work with an assembly DataSet
(since it doesn't generate Insert and Delete methods) - it only generates
"GetData" and "Update".

I think I am missing some chunk of information so would be great if you
could help!

Thanks

Will


Mar 10 '06 #6
Thanks for the info.

I have been using ObjectDataSource successfully with the GridView,
DetailsView, etc kind of thing. However, it is when I need to do some adhoc
database work that I get lost. E.g. I have a page which has a detail view
for adding a new Company record. When the page is posted back, I need to do
some updates once I have the new CompanyID. I can't see how ObjectDataSource
can let me do this - this is where I get stuck.

Would be greatful if you could help out.

Will

"Bruce Barker" <br******************@safeco.com> wrote in message
news:%2****************@TK2MSFTNGP11.phx.gbl...
read about how to interface your data layer with ObjectDataSource. The
design of the ObjectDataSource was to be used with custom data layers.

-- bruce (sqlwork.com)


"William Buchanan" <wi**************@freenet.co.uk> wrote in message
news:e1**************@TK2MSFTNGP11.phx.gbl...
Hi folks

Can anyone point me in the direction of any information on how to make a
data layer which will work with the new ASP.NET 2.0 data components
(GridView, etc)?

The reason I ask is because I want to have my data layer in a totally
separate assembly. However, this doesn't seem possible. Let me
explain....

Every site which describes how to do this seems to follow the same
pattern - half the site talks about how data layers are great, etc. Then,
when it comes to an example, they drop an SQLDataSource or an
ObjectDataSource directly on the page. Am I missing something here - to
me this isn't a data layer.

Also, when you create a DataSet in an ASP.NET application, you get
different methods to that of a DataSet in a normal assembly. In fact, in
an ASP.NET DataSet you don't even get any C# code which means that you
can't use it in normal code (so you can't create a wrapper around it). It
also means that ASP.NET components won't work with an assembly DataSet
(since it doesn't generate Insert and Delete methods) - it only generates
"GetData" and "Update".

I think I am missing some chunk of information so would be great if you
could help!

Thanks

Will


Mar 10 '06 #7
Hi Sloan
Thanks for taking the time to reply.

How do you populate and persist your Collection object? Any chance of seeing
some example code :-)

Regards
Will
"sloan" <sl***@ipass.net> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl...

Those new things are developed for "Rapid Development"...not necessarily
"well designed tiered development".

You want to the use the alternate ObjectDataSource instead.

The way I've been doing it, (but I'm not expert, and still learning 2.0)
is
that I
call the business object which returns a Collection usually (my own
implemented CollectionBase)
and then I bind the ObjectDataSource1 (because its dragged on the page) to
the MyCollection.
Then the Grid is bound to the ObjectDataSource1.

I consider MyCollection as the model, and the ObjectDataSource1 is just a
helper to get it wired up to the GridView nicely.

..


"William Buchanan" <wi**************@freenet.co.uk> wrote in message
news:e1**************@TK2MSFTNGP11.phx.gbl...
Hi folks

Can anyone point me in the direction of any information on how to make a
data layer which will work with the new ASP.NET 2.0 data components
(GridView, etc)?

The reason I ask is because I want to have my data layer in a totally
separate assembly. However, this doesn't seem possible. Let me
explain....

Every site which describes how to do this seems to follow the same

pattern -
half the site talks about how data layers are great, etc. Then, when it
comes to an example, they drop an SQLDataSource or an ObjectDataSource
directly on the page. Am I missing something here - to me this isn't a

data
layer.

Also, when you create a DataSet in an ASP.NET application, you get

different
methods to that of a DataSet in a normal assembly. In fact, in an ASP.NET
DataSet you don't even get any C# code which means that you can't use it

in
normal code (so you can't create a wrapper around it). It also means that
ASP.NET components won't work with an assembly DataSet (since it doesn't
generate Insert and Delete methods) - it only generates "GetData" and
"Update".

I think I am missing some chunk of information so would be great if you
could help!

Thanks

Will


Mar 10 '06 #8
"Marina Levit [MVP]" <so*****@nospam.com> wrote in message
news:Ol**************@TK2MSFTNGP09.phx.gbl...
Yes, all the drag and drop designer stuff is not practical or usable when
you are designing a flexible architecture that you want to abstract.

If you want it done right, you need to do it all yourself without having
the designer do it all for you. Write your insert/update/delete/select
statements yourself, etc.


I couldn't agree more!
Mar 11 '06 #9
what was the final answer (if any) i'm running into the same problem!

--
thanks (as always)
some day i''m gona pay this forum back for all the help i''m getting
kes
"William Buchanan" wrote:
Hi Sloan
Thanks for taking the time to reply.

How do you populate and persist your Collection object? Any chance of seeing
some example code :-)

Regards
Will
"sloan" <sl***@ipass.net> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl...

Those new things are developed for "Rapid Development"...not necessarily
"well designed tiered development".

You want to the use the alternate ObjectDataSource instead.

The way I've been doing it, (but I'm not expert, and still learning 2.0)
is
that I
call the business object which returns a Collection usually (my own
implemented CollectionBase)
and then I bind the ObjectDataSource1 (because its dragged on the page) to
the MyCollection.
Then the Grid is bound to the ObjectDataSource1.

I consider MyCollection as the model, and the ObjectDataSource1 is just a
helper to get it wired up to the GridView nicely.

..


"William Buchanan" <wi**************@freenet.co.uk> wrote in message
news:e1**************@TK2MSFTNGP11.phx.gbl...
Hi folks

Can anyone point me in the direction of any information on how to make a
data layer which will work with the new ASP.NET 2.0 data components
(GridView, etc)?

The reason I ask is because I want to have my data layer in a totally
separate assembly. However, this doesn't seem possible. Let me
explain....

Every site which describes how to do this seems to follow the same

pattern -
half the site talks about how data layers are great, etc. Then, when it
comes to an example, they drop an SQLDataSource or an ObjectDataSource
directly on the page. Am I missing something here - to me this isn't a

data
layer.

Also, when you create a DataSet in an ASP.NET application, you get

different
methods to that of a DataSet in a normal assembly. In fact, in an ASP.NET
DataSet you don't even get any C# code which means that you can't use it

in
normal code (so you can't create a wrapper around it). It also means that
ASP.NET components won't work with an assembly DataSet (since it doesn't
generate Insert and Delete methods) - it only generates "GetData" and
"Update".

I think I am missing some chunk of information so would be great if you
could help!

Thanks

Will



May 22 '06 #10

WebBuilder451 wrote:
what was the final answer (if any) i'm running into the same problem!


This article has a good explanation :
http://weblogs.asp.net/scottgu/archi...15/435498.aspx

This one has a sample code for a multitier application:
http://weblogs.asp.net/scottgu/archi...01/434314.aspx

Regards,

Cesar

Jun 13 '06 #11

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

Similar topics

2
by: newbie | last post by:
Hello, If I have posted the question in the wrong group, I apologize. I am building a windows application (in c#) that will be interacting with an existing Access database. This database will...
6
by: | last post by:
Hi all, is there a better way to stream binary data stored in a table in sql 2005 to a browser in .net 2.0? Or is the code same as in .net 1.1? We noticed that in certain heavy load scenarios,...
5
by: AAJ | last post by:
Hi all FIRST THE BORING BITS....... I normally use a Database layer, a Business layer and a GUI layer. The GUI uses an Object data source to bind to the Business layer which in turn binds...
2
by: kostasgio | last post by:
Hello, this is my first post here, i hope i'll find this forum usefull. Although i did a search about my question, i didnt find what i need , because the question isnt exactly what it sounds. ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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

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