/// <summary> /// ȡ�����ݿ������еı��� /// </summary> /// <param name="login">��¼</param> /// <returns>��������</returns> public List<string> getAllTables(string connectString) { List<string> ret = new List<string>(); Base_DbOperate DbOperate = new Base_DbOperate(connectString); if (!DbOperate.Open()) return null; DataTable dt = DbOperate.GetDataTable("select name from sysobjects where xtype = 'u' or xtype='v'"); foreach (DataRow dr in dt.Rows) { ret.Add(dr["name"].ToString()); } return ret; }
/// <summary> /// ȡ�����ݷ��������������ݿ��� /// </summary> /// <param name="login">��¼��Ϣ</param> /// <returns>���ݿ�������</returns> public List<string> GetAllDataBases(string connectString) { List<string> ret = new List<string>(); Base_DbOperate DbOperate = new Base_DbOperate(connectString); if (!DbOperate.Open()) return null; DataTable dt = DbOperate.GetDataTable("select name from Master.dbo.sysdatabases"); foreach (DataRow dr in dt.Rows) { ret.Add(dr["name"].ToString()); } return ret; }