JaGo
JaGo

Reputation: 257

Can I connect to multiple servers with an asp:SqlDataSource?

I have a repeater table in an asp.net application bound to an asp:SqlDataSource, and I need that data source's SelectCommand to select data from two databases in different servers.

I've been using the ConnectionString property of SqlDataSource to establish a connection to a single server, but I'm unsure of how to establish a link to multiple servers. Is this possible?

Upvotes: 1

Views: 643

Answers (1)

Nader Khazai
Nader Khazai

Reputation: 185

SqlDataSource has one ConnectionString

Two connectionStrings are needed. Make queries using each one and combine, sort or process the result in the code and then use the result for the data source of the table.

Upvotes: 4

Related Questions