I have this code that creates IList<string> :
IList<string> databases; using (MySqlConnection _conn = Session.Connection) using (MySqlCommand _cmd = _conn.CreateCommand("SHOW databases")) { _cmd.Connection.Open ( ); var _dr = _cmd.ExecuteReader(); databases = new List<string> ( _dr.SelectFromReader ( reader => reader[ 0 ] is DBNull ? null : reader[ 0 ].ToString ( ) ) ); _cmd.Connection.Close ( ); } dgrid_Main.DataSource = databases;
Follow the development of the SelectFromReader extension SelectFromReader here .
The question is how dgrid_Main displays the length of each database ...

... not a name? I checked this test:
foreach (string db in databases) {
... I get the following result:

source share