简体   繁体   中英

Can I use a stored procedure from one server on another with entity framework (asp.net mvc)?

I am writing an application which connects to multiple servers and queries their settings and inventory information to store in a database on another server. The number of servers is dynamically changing, but the server that the database information remains on is constant.

I haven't yet figured out how to create a dynamic connection using Entity Framework, but that is another question (although it would be nice to know if that is possible...). For obvious security reasons, they look down upon using raw sql strings in code to query a server and would prefer that any queries are done in the form of stored procedures.

Once I begin this and maintain a connection between the two servers, I will need to query the server that I have dynamically connected to using a stored procedure that is on the server where the information will be stored.

Is there a way to do this? Or are stored procedures limited to the server that they are placed upon?

Linked Server will work. For more information check out this link:

https://msdn.microsoft.com/en-us/library/ff772782.aspx

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM