开发者

Is it possible to create a DSN on a remote server in C#

开发者 https://www.devze.com 2023-01-04 14:42 出处:网络
I am trying to create a script such that I am given an array of server names and from these names I would like to create a system dsn on each of those respective machines.

I am trying to create a script such that I am given an array of server names and from these names I would like to create a system dsn on each of those respective machines.

I know that you can use SQLConfigDataSource() to create a dsn on your l开发者_开发技巧ocal machine, but it does not seem to give any parameters for creating the dsn on a separate machine.

Are there any functions that can achieve this result?


I would recommend using ps-exec for a task like this.


You can definitely do it, worst case you could just write the registry entries manually. To do that download Process Monitor, set it up to monitor registry changes and then create the DSN locally and you'll see what settings you need to change.

Here's an article discussing that approach also (from a script perspective, but should be easy to do in C#).

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号