How to change Connection string at runtime for window application while using Linq to Sql
-
Hi, Please help me to solve My problem. I am new To use Linq To Sql in VS 2008 Problem : I am using Linq To Sql to develop window aplication. I have one dataclass1.dbml file on which i have drag and drop the database table that i required for writting linq queries. At this time it saves connection string in app.config file and settings.designer.cs file which is hard coded and this is what i dont want. Because Whenever I install My application(i.e. EXE) at the Client side it is not fix that the server name is same as in connection string. I need to change it at runtime because i need to provide server name and Database name that are on the remote server. So please tell me how can i provide the connection string at runtime. Thanks
.
-
Hi, Please help me to solve My problem. I am new To use Linq To Sql in VS 2008 Problem : I am using Linq To Sql to develop window aplication. I have one dataclass1.dbml file on which i have drag and drop the database table that i required for writting linq queries. At this time it saves connection string in app.config file and settings.designer.cs file which is hard coded and this is what i dont want. Because Whenever I install My application(i.e. EXE) at the Client side it is not fix that the server name is same as in connection string. I need to change it at runtime because i need to provide server name and Database name that are on the remote server. So please tell me how can i provide the connection string at runtime. Thanks
.
You can either use a Connection Dialog like this[^] and let the user select it, or use the techniques used in the article for filling the lists, to locate the server/database automagically.
Henry Minute Do not read medical books! You could die of a misprint. - Mark Twain Girl: (staring) "Why do you need an icy cucumber?" “I want to report a fraud. The government is lying to us all.”