1、
/// <summary>
/// 获取表名列
/// </summary>
/// <param name="owner"></param>
private void GetTableNameList(string owner)
{
TableNameGridList.Clear();
GetTableName(owner);
var list = (from dt in DBHelper.ReturnTableName.AsEnumerable()
select new TableVo()
{
Schema = dt["OWNER"].ToString(),
Name = dt["TABLE_NAME"].ToString(),
Type = dt["TABLE_TYPE"].ToString(),
***ments = dt["***MENTS"].ToString()
}).ToList();
for (int i = 0; i < list.Count; i++)
{
TableVo tablevo = new TableVo()
{
Schema = list[i].Schema,
***ments = list[i].***ments,
Name = list[i].Name,
Type = list[i].Type
};
TableNameGridList.Add(tablevo);
}
}
2、/// <summary>
/// 获取表内容
/// </summary>
/// <param name="owner"></param>
/// <param name="name"></param>
private void GetTableContentList(string owner, string name)
{
TableContentGridList.Clear();
GetTableContent(owner, name);
var list = (from dt in ReturnTableContent.AsEnumerable()
select new TableVo()
{
Name = dt["COLUMN_NAME"].ToString(),
Type = dt["DATA_TYPE"].ToString(),
***ments = dt["***MENTS"].ToString(),
Nullable = dt["NULLABLE"].ToString(),
DataLength = dt["DATA_LENGTH"].ToString()
}).ToList();
for (int i = 0; i < list.Count; i++)
{
TableNum tablenum = new TableNum ()
{
Name = list[i].Name,
Type = list[i].Type,
***ments = list[i].***ments,
Nullable = list[i].Nullable,
DataLength = list[i].DataLength
};
TablesList.Add(tablevo);
}
}
详细代码参考
c#oracle创建实体类操作资源-CSDN文库