[英]Read database schema using NHibernate in c#
I want to give user a choice to select database in our application where number of options will be available like sqlserver,MySql,Sqlite etc.When user selects the type of database,we will show window which will ask user to input the parameters required for DB connection.This will let us connect to user's DB.But Now we want to show all tables and columns from each table to user to select particular tables and columns from it.Is it possible to implement this behavior using NHibernate?Or do I need to use ADO.NET for it? 我想给用户一个选择在我们的应用程序中选择数据库的选项,其中会有许多选项,如sqlserver,MySql,Sqlite等。当用户选择数据库类型时,我们将显示一个窗口,要求用户输入所需的参数DB连接。这将使我们连接到用户的DB。但是现在我们想向每个用户显示每个表的所有表和列,以从中选择特定的表和列。是否可以使用NHibernate来实现此行为?还是我需要使用ADO.NET吗? I have searched web to check if it is possible using NHibernate but I just got one answer here.. Using nHibernate to retrieve Database Schema I am not able to understand if this answer will solve my problem.
我已经在网上搜索过以检查是否可以使用NHibernate,但是我在这里只得到了一个答案。. 使用nHibernate检索数据库模式时,我无法理解此答案是否可以解决我的问题。
Thanks in advance 提前致谢
Many database servers implement a schema called INFORMATION. 许多数据库服务器实现一种称为INFORMATION的模式。 This is part of the ANSI Standard for RDBMSs.
这是ANSI RDBMS标准的一部分。 It contains data about the schema, tables, and views in the database.
它包含有关数据库中的架构,表和视图的数据。 I don't know how consistent the INFORMATION structures are across different implementations (eg MS SQL, MySQL, etc), or how many of them actually implement it, but that would be the place to start.
我不知道信息结构在不同的实现(例如MS SQL,MySQL等)之间的一致性如何,或者实际上有多少实现,但是那才是开始的地方。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.