Is there a library to use Linq to directly query databases dynamically?

I have a very dynamic SQL Server issue. I am developing a tool that validates consistent data across multiple databases. [NOTE: the requirements for this project are quite strict)

I need to create a C # tool that allows the user to select any database from a dynamic list, and then allows the user to select a table (acting as the original db / table). Once this is done, the user will do it again for another database and table (or multiple tables as the destination).

After selecting the source and destination, the user can select which fields are superimposed on other fields.

Finally, the program needs to loop the entries in the source table and find any corresponding keys in the destination table. It should check things like, only one key matches, all other mapped fields have the same data, etc.

I would like to use Linq in my code and just pass the rows for the fields / tables with which I run this basic logic. The problem is that the databases and schemas are unknown at compile time.

I am looking for direction on this issue. I can't seem to find a solution. The closest I came is the Linq-to-sql dynamic library, which is. But it is only dynamic within your data model. I don’t even have a data model.

I was thinking about putting all Linq stuff together completely, just by writing my own quick and dirty chain of methods to generate the basic SQL that I need (basically a fancy row builder).

+3
source share
1 answer

I do not think Linq-to-SQL is very well suited for this task. L2S surpasses your business objects from the database and updates them again - one (or several) at a time.

, Linq-to-SQL , . SQL ADO.NET(SqlDataReader ) (, sys.tables, sys.columns ..), SQL Server Management Objects (SMO) SQL-.

, , , , , - , , Linq-to-Objects , no .

:

+3
source

Source: https://habr.com/ru/post/1756668/


All Articles