What is the ASP.NET connection string format for a linked server?

I have a database server with which I cannot connect to the credentials used. However, an intermediate version of the same server has a linked server that points to a production database. The staging server and the linked server have the same scheme.

I was sure that I should expect to be able to connect to the live server before we go live. Unfortunately, I have reached a point in my development where I need more than writing samples of tokens that are currently in the intermediate database. So, I was hoping to connect to a linked server.

So far in my development against this scheme, it has been against the intermediate server itself using Subsonic objects. Everything works perfectly.

I can connect through SQL Server Management Studio to this linked server and directly execute my queries. I can also perform โ€œmanualโ€ requests in C # for the linked server by connecting the connection string to the staging server and completing my requests as

SELECT * FROM OpenQuery ([LINKEDSERVER], 'QUERY')

However, Subsonic objects are what allows me to bring this project on time and under budget, so I donโ€™t want to make direct requests in my code.

I am looking for if there is a way to specify a connection string on a linked server. I looked through a lot of forum posts, etc. On this topic, and most of the answers seem to completely obscure part of the linked question server, focusing on the syntax of the base connection string.

+5
4

, OpenQuery. sproc .

SQL Redgates . Redgates .

- , , ? , , , , .

+2

B, A . sproc B:

databaseA.dbo.tableName

/ A:

linkedServerName.databaseA.dbo.tableName

A //, /.

+2

.NET , - , sqlserver (sql, file, excel, sybase .. ..), string ( ).

0

One way is to create two connection strings and, if necessary, access the appropriate database. The second option is to create a connection only for database A and create a link server. For Databse B in the Database.good article, I really like it. I am a little versed in connecting to Asp.net, and I also found www.macrotesting.com macrotest to be a very good source. Thank you for the article...

Regards ... Meganathan.J

0
source

All Articles