473,473 Members | 2,109 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Multiple DB Selects require multiple connections?

This .Net Database stuff is way too complicated. Just to make a Select
statement on an Access database, I have to first get a connection string,
then open a connection to the database, then create an OLEDBConnection, then
an OLEDBDataAdapter, then a Dataset and then actually use the data. I
counted 12 statements before I can actually populate a Label with some data!
Or am I missing something?

OK, so the real question is, if I need to make a second Select satement, do
I need to go through this whole process all over again starting from opening
a DB connection? What about Update commands? Can I do a Select and an
Update on the same dataset?

Thanx for your input.
--
Anil Gupte
www.keeninc.net
www.icinema.com
Oct 1 '06 #1
1 1028
"Anil Gupte" <an*******@icinema.comwrote in
news:#e**************@TK2MSFTNGP02.phx.gbl:
This .Net Database stuff is way too complicated.
No not really - only because you're not used to it yet.
Just to make a
Select statement on an Access database, I have to first get a
connection string, then open a connection to the database, then create
an OLEDBConnection, then an OLEDBDataAdapter, then a Dataset and then
actually use the data. I counted 12 statements before I can actually
populate a Label with some data! Or am I missing something?
Yes, it's quite a few lines, but you can wrap everything in a data layer.

OK, so the real question is, if I need to make a second Select
satement, do I need to go through this whole process all over again
starting from opening a DB connection? What about Update commands?
Can I do a Select and an Update on the same dataset?
Yes, you can reuse the connection. Depending on the database, a single
connection may serialize the commands (i.e. multiple commands may not run
at the same time), but if this is not a problem for you (as most commands
only take a couple seconds to return), a single connection is A-OK.

BTW, take a look at LLBLGen and similar O/R mappers (.NET teirs, etc), they
map the database into a set of objects and make working with database much
nicer : )
Oct 1 '06 #2

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

Similar topics

1
by: Marc | last post by:
Hello, I have a form with multiple selects (pullDown). All selects have the same name but each select has a different value. The user selects a value in each select. When he submits the form I...
6
by: Quiet Man | last post by:
Hi all, I'm designing a fairly simple service that will run on W2K/SP4 and W2K3 servers. It's job is to be a very specialized database server that listens on a given IP address / TCP port and...
9
by: Abhishek Srivastava | last post by:
Hello All, In IIS 6.0 We have a concept of worker processes and application pools. As I understand it, we can have multiple worker process per appliction pool. Each worker process is dedicated...
5
by: Iwan Petrow | last post by:
Hi, I have an .net windows form application and sql server 2005. In one of the functions I have one connection for a sqldatareader and after that I want to use other connections to sql server...
2
by: jasonsgeiger | last post by:
From: "Factor" <jasonsgeiger@gmail.com> Newsgroups: microsoft.public.in.csharp Subject: Multiple Clients, One port Date: Wed, 19 Apr 2006 09:36:02 -0700 I'm been working with sockets for a...
1
by: Yelena Varshal via AccessMonster.com | last post by:
Hello, What are the pre-requisites / conditions for the ability to create multiple connections to MS ACCESS database and what is the precedence of its application? adModeShareDenyNone in the code,...
35
by: keerthyragavendran | last post by:
hi i'm downloading a single file using multiple threads... how can i specify a particular range of bytes alone from a single large file... for example say if i need only bytes ranging from...
1
by: Zak | last post by:
Hello, I need some help trying to grab the data selected from a checkboxlist. The checklist is acting like a menu. The first selection is accepted but not the multiple ones. For example is the...
1
by: javediq143 | last post by:
Hi All, This is my first post in this forum. I'm developing a CMS for my latest website. This CMS is also in PhP & MySQL. I'm done with the ADD section where the Admin can INSERT new records in...
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.