public class UserDA
{ SqlConnection conn;
SqlCommand cmd;
public UserDA(Use uuu)
{
conn =new SqlConnection( "server=" + uuu.Server + ";database=" + uuu.Database + ";user=" + uuu.User + ";pwd=" + uuu.Pwd);
cmd = conn.CreateCommand();
}
 public ArrayList Table(string database)
{
cmd.CommandText = "Select TABLE_NAME FROM "+database+".INFORMATION_SCHEMA.TABLES Where TABLE_TYPE='BASE TABLE' ";
conn.Open();
SqlDataReader dr = cmd.ExecuteReader();
string a = null;
if (dr.HasRows)
{
while(dr.Read())
{
a = dr["TABLE_NAME"].ToString();
al.Add(a);
}
}
cmd.Dispose();
conn.Close();
return al;
}
    public partial class Form2 : Form
{
private Use UUU;
public Form2(Use uuu)
{
InitializeComponent();
UUU = uuu;
} private void Form2_Load(object sender, EventArgs e)
{
ArrayList aaa = new UserDA(UUU).Table(UUU.Database);
for (int y = ; y < aaa.Count; y++)
{
comboBox1.Items.Add(aaa[y]);
}
}

数据库查询Database中的表的更多相关文章

  1. mysql数据库查询库中所有表所占空间大小

    SELECT CONCAT(table_schema,'.',table_name) AS 'TABLE_NAME', CONCAT(, ),'M') AS 'ROW_SIZE', CONCAT( ) ...

  2. Oracle 数据库(oracle Database)Select 多表关联查询方式

    Oracle数据库中Select语句语法及介绍 SELECT [ ALL | DISTINCT ] <字段表达式1[,<字段表达式2[,…] FROM <表名1>,<表名 ...

  3. SQL Server中模式(schema)、数据库(database)、表(table)、用户(user)之间的关系

    数据库的初学者往往会对关系型数据库模式(schema).数据库(database).表(table).用户(user)之间感到迷惘,总感觉他们的关系千丝万缕,但又不知道他们的联系和区别在哪里,对一些问 ...

  4. shell 脚本连接mysql数据库查询database中表的数量和表名

    #!/bin/bash MYSQLHOST="127.0.0.1" MYSQLUSER="root" MYSQLPWD="root" MYS ...

  5. MySQL数据库查询操作进阶——多表查询

    多表查询 在大部分情况下,我们用到的表都是彼此相关联的,所以我们会有相当大的需求用到跨表的查询,这个时候我们就需要将相关联的表连起来做多表查询. 多表查询分为连表查询和子查询,连表查询即将相关联的表连 ...

  6. JDBC查询MySQL中的表

    在数据库test里先创建表school,内容如下 创建接口对象:Statement stmt=con.createStatement(); //创建语句(Statement)ResultSet res ...

  7. JDBC动态查询MySQL中的表(按条件筛选)

    动态查询实现按条件筛选.PreparedStatement 准备语句指定要查询的表头列,.setString()通过赋值指定行,.executeQuery()执行语句 在数据库test里先创建表sch ...

  8. SQL数据库查询出一张表中重复的数据,按某个字段来查找。

    例如表名为Course 需要查询出name重复的有那些??? 解答如下: 补充: 如:查询每个姓名出现大于2次,SQL如下 SELECT COUNT(NAME) as '出现次数',  NAME FR ...

  9. 如何查询mysql中是否表被锁

    可直接在mysql命令行执行:show engine innodb status\G;(只能通过cmd或者shell登录mysql) 查看造成死锁的sql语句,分析索引情况,然后优化sql然后show ...

随机推荐

  1. 【leetcode】Word Search II(hard)★

    Given a 2D board and a list of words from the dictionary, find all words in the board. Each word mus ...

  2. oc弹出框显示提示消息

    - (void)ShowHUDTitle:(NSString *)title andDelay:(NSTimeInterval)delayTime { if (HUD) { [HUD removeFr ...

  3. supersr--NSURLSessionConfiguration-下载进度

    ////  ViewController.m//  下载进度 // //  Created by Super on 14/7/4. //  Copyright (c) 2014年 iOS. All r ...

  4. September 26th 2016 Week 40th Monday

    The land didn't move, but moved. The sea wasn't still, yet was still. 大地止而亦行,大海动而亦静. Still waters ru ...

  5. SQL存储过程大全

    --增加 create proc usp_insertToText ), ), @usitPrice decimal as begin insert into TEST1 output inserte ...

  6. Mysql 分区

    关于分区操作,可参考:http://lobert.iteye.com/blog/1955841 这篇文章写的还是比较全面的. 关于Linear hash说明,可参考:http://www.bug315 ...

  7. nyoj744(位运算)

    题目:http://acm.nyist.net/JudgeOnline/problem.php?pid=744 思路:a^b可以得到a~b间任意两个数异或运算的长度的最大值,设为n,答案为:pow(2 ...

  8. 【JAVA 文件概述】

    一.概述 使用此类的原因: 该类将文件或者文件夹封装成对象.方便对文件与文件夹的属性信息进行操作.File对象作为参数传递给流的构造函数.要求:使用File类的常用方法. windows平台下,目录分 ...

  9. Object.create 函数 (JavaScript)

    创建一个具有指定原型且可选择性地包含指定属性的对象. 语法 Object.create(prototype, descriptors) 参数 prototype 必需.  要用作原型的对象.  可以为 ...

  10. scrollTop和scrollLeft的兼容解决万全方法

    1.各浏览器下 scrollTop的差异 IE6/7/8: 对于没有doctype声明的页面里可以使用  document.body.scrollTop 来获取 scrollTop高度 : 对于有do ...