Re: [2005] Connection String
If you create a Data Source then the IDE offers to put your connection string in the config file by default. Then you only have to edit the config file on each system. Alternatively you can build your connection string using a SqlConnectionStringBuilder, getting the individual properties from wherever you like, e.g. the config file or direct user input.
Re: [2005] Connection String
Quote:
If you create a Data Source then the IDE offers to put your connection string in the config file by default.
Are you referring on databinding ?
Quote:
Alternatively you can build your connection string using a SqlConnectionStringBuilder, getting the individual properties from wherever you like, e.g. the config file or direct user input.
How to do that ?
Re: [2005] Connection String
Quote:
Originally Posted by aNubies
How to do that ?
Quote:
build your connection string using a SqlConnectionStringBuilder
and then
Quote:
getting the individual properties from wherever you like, e.g. the config file or direct user input.
You'll have to be more specific if you want more answers.
Re: [2005] Connection String
Take a look to SQL ConnectionStringDialog
It is a dll (with source) for displaying a dialog for connecting, browse the database, create the connectionstring, test it, and save the string to the application settings.
In my apps I try a connection in the load event. If fails, then I open a SQLConnectionDialog.
Additionnally, there is a OLEDb connection dialog, so I have modified the class for connecting to access databases.
Alex
Re: [2005] Connection String
Quote:
Originally Posted by aNubies
Are you referring on databinding ?
No, I'm referring to creating a Data Source froem either the Data Sources window or the main menu. That will add an entry to your Data Sources window and create a corresponding typed DataSet class. You can then create instances of that class in code, which might then be bound to your controls. Data-binding is not limited to DataSets though.