Previous topicNext topic
Help > 开发指南 > SanMuGrid平台编程 > 主要对象 > Database > 数据处理 >
GetListOfColumnName

GetListOfColumnName获得数据表中所有列名清单,以集合的形式返回。

语法:

GetListOfColumnName(strTableName)

参数名称  说明
  strTableName 为要查询的表名称。

Vb.Net
Dim db As Database=Proj.SysDataFactory("UserDB")
Dim lst As List(Of String)=db.GetListOfColumnName("EmployeeInfo")
Proj.MsgDebug.Add(String.Join(",",lst.ToArray())) 

'返回结果:EmployeeID,FullName,IDNumber,Gender,BirthDate,Married,PoliticalStatus,Nation,Education,
'NativePlace,CurrentAddress,HomePhone,TelephoneNO,Photo,Department,CreateTime,Position,EntryDate,
'DepartureDate,InPosition,blnDelete,CreateUser,_LockRowFlag,_SortFlag,_IdentifyFlag,AddressProvince,
'AddressCity,AddressDetailAddress,AddressArea,TitleID,ModifyUser,ModifyTime,FIndex,Age,status,SingleTime

C#
Database db = Proj.SysDataFactory["UserDB"];
List<string> lst = db.GetListOfColumnName("EmployeeInfo");
Proj.MsgDebug.Add(string.Join(",", lst.ToArray()));
//返回结果:EmployeeID,FullName,IDNumber,Gender,BirthDate,Married,PoliticalStatus,Nation,Education,
//NativePlace,CurrentAddress,HomePhone,TelephoneNO,Photo,Department,CreateTime,Position,EntryDate,
//DepartureDate,InPosition,blnDelete,CreateUser,_LockRowFlag,_SortFlag,_IdentifyFlag,AddressProvince,
//AddressCity,AddressDetailAddress,AddressArea,TitleID,ModifyUser,ModifyTime,FIndex,Age,status,SingleTime