I am trying to figure out how I can only list specific databases in my combo box for databases. I have several database that all contain _Logging. I just want the logging ones to show up in the combo box. How do I accomplish this? After the getScheme is called, do I need to call another query to do something like ‘%Logging%’ query or something like that?
var databases = sqlConnection1.GetSchema("Databases");
foreach (DataRow database1 in databases.Rows)
{
String dbName = database1.Field<String>("database_name");
Console.WriteLine(dbName);
cmbDatabaseList.Items.Add(dbName);
}
Why dont you just do: