/// <summary> /// 获得所有表,注意返回的集合中的表模型中只有表名 /// </summary> /// <returns></returns> public List <TableStruct> ShowTables() { DataSet ds = GetDataSet("select TABLE_NAME from INFORMATION_SCHEMA.TABLES t where t.TABLE_TYPE ='BASE TABLE'"); TableStruct tbl = null; List <TableStruct> list = new List <TableStruct>(); for (int i = 0; i < ds.Tables[0].Rows.Count; i++) { tbl = new TableStruct(); tbl.Name = ds.Tables[0].Rows[i][0].ToString(); list.Add(tbl); } return(list); }
/// <summary>获得所有表,注意返回的集合中的表模型中只有表名 /// </summary> /// <returns></returns> public List <TableStruct> ShowTables() { DataSet ds = GetDataSet("select TABLE_NAME from user_tables"); TableStruct tbl = null; List <TableStruct> list = new List <TableStruct>(); for (int i = 0; i < ds.Tables[0].Rows.Count; i++) { tbl = new TableStruct(); tbl.Name = ds.Tables[0].Rows[i][0].ToString(); list.Add(tbl); } return(list); }
/// <summary>获得所有表,注意返回的集合中的表模型中只有表名 /// </summary> /// <returns></returns> public List <TableStruct> ShowTables() { DataSet ds = GetDataSet("select tbl_name from sqlite_master where type='table'"); TableStruct tbl = null; List <TableStruct> list = new List <TableStruct>(); for (int i = 0; i < ds.Tables[0].Rows.Count; i++) { tbl = new TableStruct(); tbl.Name = ds.Tables[0].Rows[i][0].ToString(); list.Add(tbl); } return(list); }