C#2不同的mssql连接 [英] C# 2 different mssql connection
本文介绍了C#2不同的mssql连接的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
你好
我想写一个ac#程序,这是应用程序使用一个mssql服务器的设置之一,其他设置使用不同的mssql服务器是否可能?
我可以同时连接2个不同的sql server同一个应用程序吗?
我该怎么做?
我尝试了什么:
一些搜索,谷歌搜索,看一些书
Hello
I want to write a c# program which is one of settings of application use one mssql server and the other settings use different mssql server is it possible?
Can i connect 2 different sql server same application same time?
How can i do this?
What I have tried:
some search,google search,looking some books
推荐答案
是的,你只需要两个SqlConnection对象。
你不能在同一个查询中合并两个服务器:例如你不能使用JOIN来选择相关的记录来自不同服务器上的两个表。但你可以向其中一个发出SQL命令。
你究竟想做什么?
Yes, all you need is two SqlConnection objects.
You can't "combine" two servers in the the same query: for example you can't use a JOIN to SELECT related records from two tables on different servers. But you can issue SQL commands to one or the other.
What exactly are you trying to do?
这篇关于C#2不同的mssql连接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文