Global DB Connections...RunTime Variable used for Design-Time DataAdapter Connection 
Author Message
 Global DB Connections...RunTime Variable used for Design-Time DataAdapter Connection

I have created an SQLConnection through input from an .ini file, and now
would like to use this connection for all DataAdapters, Commands, and
DataReaders throughout my application.  Is there a way to use the designed
DataAdapters and assign a variable to the connection string or the
connection itself.

If I go into the "InitializeComponent" sub-routine (that you are not
supposed to edit) and change the connectionstring to the variable, I get a
design time error that the variable name has not been declared, yet it is
clearly a public variable and also works fine with run-time instances of the
DataAdapter control.

So in summary, how do you assign a run-time variable value to a design time
DataAdapter Connection string...or is it possible at all.



Wed, 22 Dec 2004 22:43:56 GMT  
 Global DB Connections...RunTime Variable used for Design-Time DataAdapter Connection
Hi Clint,

Actually you set the ConnectionString propert of the SqlConnection
variable. Then set the SqlDataAdapter's command.Connection (e.g.
SelectCommand, UpdateCommand, etc.) to the SqlConnection variable.

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

Regards,

Bill Cheng
Microsoft Support Engineer
--------------------

| Subject: Global DB Connections...RunTime Variable used for Design-Time
DataAdapter Connection
| Date: Sat, 6 Jul 2002 10:43:56 -0400
| Lines: 18
| Organization: InterGlobal Solutions
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.2600.0000
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000

| Newsgroups: microsoft.public.dotnet.languages.vb
| NNTP-Posting-Host: 24.102.232.69
| Path: cpmsftngxa07!tkmsftngp01!tkmsftngp10
| Xref: cpmsftngxa07 microsoft.public.dotnet.languages.vb:53519
| X-Tomcat-NG: microsoft.public.dotnet.languages.vb
|
| I have created an SQLConnection through input from an .ini file, and now
| would like to use this connection for all DataAdapters, Commands, and
| DataReaders throughout my application.  Is there a way to use the designed
| DataAdapters and assign a variable to the connection string or the
| connection itself.
|
| If I go into the "InitializeComponent" sub-routine (that you are not
| supposed to edit) and change the connectionstring to the variable, I get a
| design time error that the variable name has not been declared, yet it is
| clearly a public variable and also works fine with run-time instances of
the
| DataAdapter control.
|
| So in summary, how do you assign a run-time variable value to a design
time
| DataAdapter Connection string...or is it possible at all.
|
|
|
|
|



Fri, 24 Dec 2004 22:40:03 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. global variables to DB connections.

2. Set db as global variable?

3. help using coded connec. instead of datacontrol

4. Global oracle db connection

5. setting DB connection in global.asa

6. Assign a treeview at design run time to other at design time

7. Connection Standards - Global Variable???

8. ADODC: Design vs Runtime Connection

9. Edit controls w/code (design-time not runtime)

10. Form size changes in runtime vs design time modes

11. how do draw vb6 type graphics on a form (design time not runtime)

12. DBGrid Runtime/ Design Time error

 

 
Powered by phpBB® Forum Software