public void ReaderDBName() { SerHelp help = new WinDBTool.SerHelp(); help.strCon = connStr; SqlDataReader reader = help.Reader("SELECT Name FROM Master..SysDatabases ORDER BY Name"); while (reader.Read()) { string dbName = reader["Name"].ToString(); ListViewItem lvitem = lvRemoteDB.Items.Add(dbName); lvitem.Tag = dbName; lvitem.SubItems.Add(dbName); } }
public bool IsExetis(string dbName) { SerHelp help = new WinDBTool.SerHelp(); help.strCon = connStr; SqlDataReader reader = help.Reader("SELECT Name FROM Master..SysDatabases ORDER BY Name"); bool ok = false; while (reader.Read()) { if (dbName == reader["Name"].ToString()) { ok = true; } } return(ok); }