المساعد الشخصي الرقمي

مشاهدة النسخة كاملة : How to change Connection string at runtime for window application while using Linq to Sql



C# Programming
06-02-2009, 11:11 AM
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

.