I am getting the following error:
An object or column name is missing or empty. For SELECT INTO statements, verify each column has a name. For other statements, look for empty alias names. Aliases defined as "" or [] are not allowed. Add a name or single space as the alias name.
For the query show below:
if (comboBox1.SelectedIndex > -1) {
// comboBox1.UpdateLayout();
SqlCom.CommandText = "select distinct table_name from [" +comboBox1.Text + "].information_schema.columns c inner join [" + comboBox1.Text + "].sys.tables t on c.table_name = t.name order by table_name";
using (SqlDR = SqlCom.ExecuteReader()) {
comboBox2.Items.Clear();
while (SqlDR.Read()) {
comboBox2.Items.Add(SqlDR.GetString(0));}
}
}
Any idea what the problem is here?
I fill combobox1 whit : `SqlCom.CommandText = "select * from sys.databases where database_id > 4 order by name"; This works ok