日期:2014-05-18  浏览次数:20952 次

executereader无可用的连接,已关闭
if   (this.comboBox1.SelectedItem.ToString   ()   ==   "蜀山区 ")
                        {

                                if   (dbcon   ==   null)
                                {
                                        dbcon   =   leiku.connection.sqlconnect();

                                }
                                SqlCommand   sqlcmd0   =   dbcon.CreateCommand();
                                sqlcmd0.CommandText   =   leiku.connection.getshushandiqu();
                                SqlDataReader   sqlD   =   sqlcmd0.ExecuteReader();
                                if   (sqlD.Read())
                                {
                                        this.listBox1.Items.Clear();
                                        this.listBox1.Items.Add(sqlD.GetString(0).Trim());
                                       
                                }
                                //sqlcmd.Dispose();
                                //sqlD.Close();
                        }
                        else   if   (this.comboBox1.SelectedItem.ToString   ()   ==   "包河区 ")
                        {
                                SqlCommand   sqlcmd1   =   dbcon.CreateCommand();
                                sqlcmd1.CommandText   =   leiku.connection.getbaohediqu();
                                MessageBox.Show(sqlcmd1.CommandText.ToString());
                                SqlDataReader &nb