List Info

Thread: Database access without using a dataset




Database access without using a dataset
user name
2006-06-21 16:28:32
From:    Kelly Baker <kbakerHOWARD-IND.COM>

>I need to access an ODBC database (Connx), running a
single
>query at a time. I DO NOT want to set up or fill a
dataset
>because of the immense size of this database.

That's like saying you don't want a piece of paper because
there are so many trees in the forest.

It is very easy to produce a small dataset by querying a
large
database - just use queries that don't return many rows. It
is
almost as easy to produce a huge dataset by querying a small
database (a few cartesian joins will help here).

>How do I set up a database connection in .Net 2.0 so I
can
>open a connection, run a query on the database, and
close the
>connection, retrieving only the data I am querying for?

You might look at a datareader. The thing with a datareader,
though, is (as I understand it) you can't close or reuse
the
connection until you are through with the data. A connection
is
a rather substantial resource on BOTH ends, and the server
probably has a limited supply of them. A dataset is much
less
resource intensive.

>Every time I try to use the Data Source Wizard, it tries
to set
>up a dataset.

That's excellent. You just need to have a look at how it's
going
to populate that dataset. You want it populated with the
data
you want, not all data in the database.

If you're updating the data, you also need to think about
concurrency.

===================================
This list is hosted by DevelopMentorŪ  http://www.develop.com

View archives and manage your subscription(s) at http://discuss.develop.com

EnableViewState = False
user name
2006-06-22 12:36:17
Hi, I'm trying to stop the viewstate by setting the page
directory
EnableViewState = False, but seem that there still a
viewstate happening
when I post the html of my form to aother site when I look
at the source
there a runat=server form created and the viewstates between
the tag. Is
there another way to double stop the viewstate from
happening 

I'm using asp.net 1.1 and I only whant that particular page
to stop having
viewstate.

===================================
This list is hosted by DevelopMentorŪ  http://www.develop.com

View archives and manage your subscription(s) at http://discuss.develop.com

[1-2]

about | contact  Other archives ( Real Estate discussion Medical topics )