How to change connection string at run time
Posted: Mon Jun 15, 2009 4:40 am
Hi,
I need to change the connection string at run time. How can I do it? The reason is I had implemented the repoting at development environment, then later deploy it to other location (different server and SQL login info). What I want to do is just changing the connection string (sql created in report remain unchange).
For example :
the current connection string is "server=devcomp3; user id=sa; password=; database=dbLMS" and I need to change it to "server=SST-KKNS; user id=sa; password=12345; database=dbLMS".
I have searched through the forum but couldn't find a way to do it.
Many Thanks in advance.
ringo
I need to change the connection string at run time. How can I do it? The reason is I had implemented the repoting at development environment, then later deploy it to other location (different server and SQL login info). What I want to do is just changing the connection string (sql created in report remain unchange).
For example :
the current connection string is "server=devcomp3; user id=sa; password=; database=dbLMS" and I need to change it to "server=SST-KKNS; user id=sa; password=12345; database=dbLMS".
I have searched through the forum but couldn't find a way to do it.
Many Thanks in advance.
ringo