分类：电脑/网络-互联网
问题：treeview如何来加载数据库中的数据呢？ 
回答：try            {                Sqlonnection cnn = new SqlConnection(ConnectionString);                cnn.Open();                SqlCommand myCmd = new SqlCommand();                myCmd.CommandText = "select a from a";                myCmd.Connection = cnn;                SqlDataReader myReader = myCmd.ExecuteReader();                while (myReader.Read())                {                    TreeNode tt = new TreeNode();                    tt.Text = myReader.GetString(0);                    treeView.Nodes.Add(tt.Text);                }                cnn.Close();            }            catch (Exception ex)            {                MessageBox.Show(ex.Message);            }            finally            {            }