I now is to TableA TableB and take into two DataTable, then traverse to find A record in B, such feelings do down efficiency is very low,
In addition there is a kind of thinking is converted to IQueryable, reoccupy lamba expression to make the connection, don't know the performance will improve
CodePudding user response:
Sql Server across Server connectionCodePudding user response:
With the DataTable or IQueryable<> Has nothing to do, mainly is don't have nothing to do in the process of query data record reads to the client to deserialize, or almost all the time on the communication,CodePudding user response:
1, can be read separately, the corresponding data of different database, the data in the server's memory for finishing operation, (this way should be large amount of data when there will be a problem, and actually the efficiency is not high, but would be a simple)2, also can be connected to other database SQL statements to query (statement of how to write under the baidu ah, I remember that seems to be some), but I think this way to me, because not used to, no practical experience,
CodePudding user response:
Put one of the data and the other a temporary database table is bad?CodePudding user response:
If the data volume is not large, so all out, again, no problem, use the DataTable and use the List is fine, of course the List had better, the DataTable is not bad, is eliminated, theIf two table data quantity is big, and ultimately more after the relatively small amount of data, then suggested reader, reading in the process of comparison and analysis,
==========
Latest articles: interpretation of the classic "advanced programming c #" in the fourth chapter of the generic constraint https://mp.weixin.qq.com/s/ZHiaTpzBD-OdPs0Eo7iawQ
Welcome attention WeChat public good "knowing and doing" product technology, make full of structured knowledge base, including the original articles, free classes (c #, Java, Js), technology project, knowledge view, the source code download content, such as
CodePudding user response:
Database A and database B, is on A server?If it is the same MSSQL two libraries, then directly across the table join,
[name] [dbo]. [table name]
If they are two different servers, so I remember SQL login is across the library statement, after landing can still cross-database queries,
Specific you can check it,
Really not line, then from the two libraries into the filter condition, the data read down, and then join in the code
CodePudding user response: