Monday, March 26, 2012

newbie asp/ado.net question.

Hi,

I am very new to .net but not new to asp or ado.

I am just wondering the best way to do the following...

I have a database which stores a list of messages/threads (like google
newsgroups threads). I want to display these on a webpage where each message
is a hyperlink, and each message has a treeview drill-down mechanism where
you can see replies for a particular message (just like in outlook express
newsgroups).

i have an aspx page which i want to display the data and an object which
should do all the retrieving/updating of data.

what is the best way to do this (in terms of using datareader, dataset,
etc). and where would be the logical place to dim these objects (asp or
object)?

one more thing... i would like to return the data from the object in XML
(unless .net has a newer easier way in presenting such information!)

thanks.One of the great things about .NET is the fact that there are tons of ways
to accomplish the same task, so I'm sure you will get tons of answers. ;-)

That being said, if all you want to do, is format the equivalent of a
forward-looking ado recordset, then I would just databind a DataReader to a
DataList or Repeater.

However, if you want to go with XML, I would bring back a dataset, and then
use the WriteXML() method.

hth,
Dave
www.aspNetEmail.com

"linz" <linz@.nospam.com> wrote in message
news:uy8yVwZQDHA.2480@.tk2msftngp13.phx.gbl...
> Hi,
> I am very new to .net but not new to asp or ado.
> I am just wondering the best way to do the following...
> I have a database which stores a list of messages/threads (like google
> newsgroups threads). I want to display these on a webpage where each
message
> is a hyperlink, and each message has a treeview drill-down mechanism where
> you can see replies for a particular message (just like in outlook express
> newsgroups).
> i have an aspx page which i want to display the data and an object which
> should do all the retrieving/updating of data.
> what is the best way to do this (in terms of using datareader, dataset,
> etc). and where would be the logical place to dim these objects (asp or
> object)?
> one more thing... i would like to return the data from the object in XML
> (unless .net has a newer easier way in presenting such information!)
> thanks.
hmm... kinda hard to answer, because I don't know enough about your app.

You wanted XML, I was just making you aware there is a WriteXML() method on
the DataSet, that's all.

If you can, I would return all the data at once, as much as makes sense.
Database connections are relatively expensive, so I would try to minimize
them to a certain extent.

I don't understand what you mean about scope, as the architecture of the web
as stayed the same (still stateless), just the way we are designing apps has
changed 1000%.

You may want to try a different ideas, and ask about more opinions.

hth,
Dave
www.aspNetEmail.com

"phillipa" <phillipa@.nospamming.com> wrote in message
news:urfF0SaQDHA.4024@.tk2msftngp13.phx.gbl...
> thanks, so do you mean dim a dataset in my object and use it to return xml
> back to the aspx page.?
> what about scope? does it work in the same way as classic asp? (ie:
> everytime a user clicks on a message, should i be recreating a connection
to
> the database in my object and populating the message data into a dataset
> then writing the xml back to the aspx page?)
> this is the bit i am unclear about.
>
> "dave wanta" <nospam@.nospam.com> wrote in message
> news:%23r09syZQDHA.2460@.TK2MSFTNGP10.phx.gbl...
> > One of the great things about .NET is the fact that there are tons of
ways
> > to accomplish the same task, so I'm sure you will get tons of answers.
;-)
> > That being said, if all you want to do, is format the equivalent of a
> > forward-looking ado recordset, then I would just databind a DataReader
to
> a
> > DataList or Repeater.
> > However, if you want to go with XML, I would bring back a dataset, and
> then
> > use the WriteXML() method.
> > hth,
> > Dave
> > www.aspNetEmail.com
> > "linz" <linz@.nospam.com> wrote in message
> > news:uy8yVwZQDHA.2480@.tk2msftngp13.phx.gbl...
> > > > Hi,
> > > > I am very new to .net but not new to asp or ado.
> > > > I am just wondering the best way to do the following...
> > > > I have a database which stores a list of messages/threads (like google
> > > newsgroups threads). I want to display these on a webpage where each
> > message
> > > is a hyperlink, and each message has a treeview drill-down mechanism
> where
> > > you can see replies for a particular message (just like in outlook
> express
> > > newsgroups).
> > > > i have an aspx page which i want to display the data and an object
which
> > > should do all the retrieving/updating of data.
> > > > what is the best way to do this (in terms of using datareader,
dataset,
> > > etc). and where would be the logical place to dim these objects (asp
or
> > > object)?
> > > > one more thing... i would like to return the data from the object in
XML
> > > (unless .net has a newer easier way in presenting such information!)
> > > > thanks.
> >

0 comments:

Post a Comment