简体   繁体   English

在C#中使用NHibernate读取数据库架构

[英]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.

相关问题 使用Asp和C#在MySql中进行Nhibernate数据库连接 - Nhibernate database connection in MySql using Asp& C# 使用NHibernate / C#从数据库中预加载树/层次结构 - preloading a tree / hierarchy from database using NHibernate / C# 如何在C#中使用反射读取平面文件的架构 - How to Read Schema of Flat File using Reflection in C# 如何使用C#复制MySql数据库模式? - How to copy a MySql database schema using C#? C#中的NHibernate不同的数据库备份 - NHibernate different database backup in C# 如何将用户复选框检查写入数据库中的多条记录 - 使用 MVC、C#、Razor、nHibernate - How to write Users checkbox checks into multiple records in database - using MVC, C#, Razor, nHibernate 使用C#创建的NHibernate从多个应用程序向SQL Server数据库进行事务处理 - Transactions to a SQL Server database from multiple application using NHibernate created with C# 使用Nhibernate(C#)的Oracle数据库映射(数据库不包含PK) - Oracle Database mapping with Nhibernate (C#)(database does not contain PK) 在MySQL,NHibernate和C#中使用自动增量 - Using Auto Increment with MySQL, NHibernate and C# 使用IRepository的C#共享事务和NHibernate - C# Shared Transactions and NHibernate using IRepository
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM