作者hpo14 (陌生)
看板C_Sharp
标题Re: [问题] 请问如何用comboBox下拉式选单选取资料 …
时间Mon Aug 18 19:50:06 2008
: 只是不知道该如何取得每个资料表的名字
不知道你所谓的抓名字,是要从资料库抓,还是说你已经把全部的表塞进 DataSet
了,如果是後者..那应该可以用回圈去抓出 Tables 的名字
以下是 google 到的查询有哪些资料表的语法..
= SQL Server
1.取得资料库表单数量
select count(*) as totaltablenumber
from sysobjects
where xtype = 'U';
2.取得资料表名称(tablename)及栏位数量(columnnumber)
select name as tablename, info as columnnumber
from sysobjects
where xtype = 'U';
3.取得某一资料表内所有栏位名称
select b.name
from sysobjects as a, syscolumns as b
where a.xtype = 'U' and a.id = b.id and a.name='资料表单名称';
3.1 取得某一资料表内所有栏位名称
EXEC sp_columns 表单名称
= MySQL
1.取得资料库表单数量
show tables; 之後再加总
2.取得资料表名称及栏位数量及所有栏位名称
describe 表单名称; 之後可取得资料库栏位名称及数量
= MS ACCESS
1.取得资料库表单数量
Select count(*) as TotalTableNumber
Ffrom MSysObjects
where Type = 1 and Flags = 0;
2.取得资料表名称
Select name as tablename
From MSysObjects
where Type = 1 and Flags = 0;
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 61.59.78.243
1F:推 teamspike:thx a lot 08/19 11:37
2F:推 tomex:效能评比: count(*) < count(column1) < count(1) 08/19 23:34