Re: Setting the Connectionstring of sqlconnection at design time
- From: Grant Smith <grant.smith@xxxxxxxxxxxxxxx>
- Date: Wed, 16 Nov 2005 01:39:54 GMT
Jose Valle wrote:
I would set a global string variable named myConnectionString (or something else that is self-explanatory) and reference that wherever you need it. If you need to change it, you only have to change it in one place.Hello all,
I have a question/problem that you maybe able to help me with...
I would like to set the connections string property of a sqlconnection object at design time to something other than a static string. Something like shared member of a class or possibly a value in a config file.
I need it at design time because design time behavoir of other controls on my form depend on a connection object with a configured connectionstring property.
I have tried setting up a connection via server explorer that allows me to use the dropdown on the connectionstring property to select it, however, all that does is pull in the generated connection string. this is a problem because If i need to make a change to the connection string later, I will have to manually search and replace thru out the application.
please let me know if I should clarify further.... :) Any help/guidance is greatly appreciated.
-Jose
-- Grant Smith A+, Net+, MCP x 2
Quality Production Liaison Hewlett Packard Company
Database Administrator Renaissance Systems and Services, LLC .
- References:
- Setting the Connectionstring of sqlconnection at design time
- From: Jose Valle
- Setting the Connectionstring of sqlconnection at design time
- Prev by Date: Setting the Connectionstring of sqlconnection at design time
- Next by Date: .
- Previous by thread: Setting the Connectionstring of sqlconnection at design time
- Next by thread: .
- Index(es):
Relevant Pages
|