小编War*_*sMe的帖子

NHibernate动态列号

在我的C#项目中,我需要在代码中创建一个数据库,其中一个表具有动态列号.像这样

------------------------------------------------------------------------------     
| Time        ¦ Element #1       | Element#2        ¦ ... ¦ Element#N        ¦
------------------------------------------------------------------------------
¦ TimeValue#1 ¦ Element#1Value#1 ¦ Element#2Value#1 ¦ ... ¦ Element#NValue#1 ¦
¦ TimeValue#2 ¦ Element#1Value#2 ¦ Element#2Value#2 ¦ ... ¦ Element#NValue#2 ¦
                                      ...
¦ TimeValue#M ¦ Element#1Value#M ¦ Element#2Value#M ¦ ... ¦ Element#NValue#M ¦
------------------------------------------------------------------------------
Run Code Online (Sandbox Code Playgroud)

我使用简单的SQL查询'SQL CREATE TABLE'

public void AddTable(string TableName, Dictionary<string,Type> columns)
{        
    ...
    string query = @"CREATE TABLE " + TableName + "(";

    foreach (var c in columns)
    {
        SqlParameter temp = …
Run Code Online (Sandbox Code Playgroud)

c# sql nhibernate dynamic

4
推荐指数
1
解决办法
2773
查看次数

标签 统计

c# ×1

dynamic ×1

nhibernate ×1

sql ×1