Wrox Programmer Forums
|
BOOK: Beginning ASP.NET 1.0
This is the forum to discuss the Wrox book Beginning ASP.NET 1.0 with C# by Chris Goode, John Kauffman, Christopher L. Miller, Neil Raybould, S. Srinivasa Sivakumar, Dave Sussman, Ollie Cornes, Rob Birdwell, Matt Butler, Gary Johnson, Ajoy Krishnamoorthy, Juan T. Llibre, Chris Ullman; ISBN: 9780764543708
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning ASP.NET 1.0 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old August 2nd, 2004, 10:08 AM
Authorized User
 
Join Date: Jul 2004
Posts: 71
Thanks: 0
Thanked 0 Times in 0 Posts
Default Database Connection Object

Hello,

I am trying to create a DB Connection Object called "objDBConn"
I want to re-use this object through my VB.NET application, thus why I am creating an object. My question is: Should I put all connection info in my object such as connection string, etc?

Please any help with this is greatly appreciated.

Thanks in Advance,
Mark


 
Old August 2nd, 2004, 01:45 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,998
Thanks: 0
Thanked 3 Times in 3 Posts
Default

Hey,

I don't know if you want an open connection to a database at a globular level. You can create an object at each form or web page level, then make it accessible to an entire form. But for performance, it is wiser to open and close it only when you need it.

Brian
 
Old August 2nd, 2004, 04:36 PM
Authorized User
 
Join Date: Jul 2004
Posts: 71
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi Brian,

Thanks for the reply. I have been reading about accessing the Database from the system registry...This way it is easier to install the application.

You know anything about that...

Thanks,
Mark

 
Old August 3rd, 2004, 07:05 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,998
Thanks: 0
Thanked 3 Times in 3 Posts
Default

Hey,

Never heard of storing the database, but it is common practice to store the connection string in the database to connect to in the registry.

Brian
 
Old August 3rd, 2004, 07:42 AM
Authorized User
 
Join Date: Jul 2004
Posts: 71
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Sorry, that is what I meant. I want to store the connection string to the database, in the registry. Then access the connection String in the registry from my objDBConn.
I have most of this figured out and understand it, the only thing I am having trouble with now is, I am not sure if I need to call the string value in my registry.
Example:
In Registry my file is like this:
LocalMachine\Software\MyApp\ConnectionString
Do need to specify it like this
OR do I just need Software\MyApp

Thanks in Advance,
Mark







Similar Threads
Thread Thread Starter Forum Replies Last Post
Connection String (Object) ssimkhan Visual Basic 2005 Basics 1 June 1st, 2007 10:41 AM
Connection String(object) ssimkhan Visual Studio 2005 1 May 31st, 2007 04:54 PM
Global Connection Object sarahmapg ADO.NET 1 May 18th, 2005 06:00 AM
Connection Object question Kenny Alligood VB Databases Basics 5 July 15th, 2004 07:50 PM
Connection Object shahchi1 ADO.NET 5 June 1st, 2004 11:48 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.