centralized data source and data tables for multiple form VB Application 
Author Message
 centralized data source and data tables for multiple form VB Application

This may be a newbie question but I have to ask to try and save time.

I am creating a VB.Net application with more than 50 forms and need a way
to:
1) access a centralized group of tables that I can use multiple times
without requiring form specific data connections, readers, etc.  In VB 6 I
was able to use the Data Environment, what is the .Net equivalent.
2) Call a connection string from an .INI file at project start-up, (already
am doing) but than use that connection for all data adapters/ readers/etc.
throughout an entire application.  When I change the data source I have to
go into each form and update it manually, what a pain.

Any quick hints would be greatly appreciated.



Tue, 21 Dec 2004 22:57:32 GMT  
 centralized data source and data tables for multiple form VB Application
I would start by abstracting out the data access into a separate set of
classes that are designed to do nothing but the data access.  Create a
"controller" class that has all of the common information in it (i.e. the
connection string information, and any other special requirements) .  Place
them all into a separate DLL (Class Library).  Now only use the exposed
interfaces from the DLL to pass the needed data to your forms.  (I would
look at possibly having one interface per form).

This give a clean and clear spot for you to do all of the data work in one
place, and lets the rest of your application worry about displaying the
data.

HTH

David


Quote:
> This may be a newbie question but I have to ask to try and save time.

> I am creating a VB.Net application with more than 50 forms and need a way
> to:
> 1) access a centralized group of tables that I can use multiple times
> without requiring form specific data connections, readers, etc.  In VB 6 I
> was able to use the Data Environment, what is the .Net equivalent.
> 2) Call a connection string from an .INI file at project start-up,
(already
> am doing) but than use that connection for all data adapters/ readers/etc.
> throughout an entire application.  When I change the data source I have to
> go into each form and update it manually, what a pain.

> Any quick hints would be greatly appreciated.



Wed, 22 Dec 2004 13:14:21 GMT  
 centralized data source and data tables for multiple form VB Application
You could create a component class and drag a connection on to it.  Then in
each of your forms you could dim a new instance of the component and use its
connection property for your connection.  Then when you need to change the
data source, you can just change it in the class.

Eric and Ron
Visual Basic Team

--
This posting is provided "AS IS" with no warranties, and confers no rights.

Quote:
> This may be a newbie question but I have to ask to try and save time.

> I am creating a VB.Net application with more than 50 forms and need a way
> to:
> 1) access a centralized group of tables that I can use multiple times
> without requiring form specific data connections, readers, etc.  In VB 6 I
> was able to use the Data Environment, what is the .Net equivalent.
> 2) Call a connection string from an .INI file at project start-up,
(already
> am doing) but than use that connection for all data adapters/ readers/etc.
> throughout an entire application.  When I change the data source I have to
> go into each form and update it manually, what a pain.

> Any quick hints would be greatly appreciated.



Sat, 08 Jan 2005 04:22:29 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Extracting data from multiple tables, for use on a VB Form

2. Accessing centralized data from Outlook form

3. Data Report And Multiple Data Source

4. Access virtually any data source : Report off in-memory application data

5. Syntax for importing data into an Access table from an ODBC data source

6. VB and multiple data sources

7. Data Form Wizard and ODBC Data Source

8. Using VB application as source for Excel data

9. Problems with data control in VB 4.0 and ODBC data sources

10. Source code for VB's Data Form Wizard

11. Source code for VB's Data Form Wizard

12. multiple data sources

 

 
Powered by phpBB® Forum Software