Is it possible to programmatically create a DBLink in SQL server 2005 in C#?
Suppose I have database A and B. I want to create a DBlink in A to connect B. I will capture the B database info from user and create the DBLink in database A. Is this possible in C# .Net version 2.0?
You can add a linked server with sp_addlinkedserver:
From C#, you can store this query in a SqlCommand, and call ExecuteNonQuery() to execute it on the database.