国产成人AV一区二区三区在线_国产成人精品无码免费看_国产成人无码无卡在线观看_国产精品成人A区在线观看_国产日韩精品欧美一区_国产亚洲精品自在久久蜜TV_久草热久草热线频97精品_久久久噜噜噜久久中文福利_久久婷婷五月综合色国产免费观看_日日狠狠久久偷偷色综合0,九一桃色在线观看,久久97精品久久久久久久不卡,国产成人精品亚洲精品

C#中變量作用域的問(wèn)題,請(qǐng)各位大俠看看,這段代碼錯(cuò)在哪,?

訪客2025-01-17 09:38:551

class DBConnection { private mysqlConnection connection; // public mysqlConnection connection; private string connectionStr; public DBConnection() { try { connectionStr = ConfigurationManager.ConnectionStrings["connStr"].ConnectionString; connection = new MySqlConnection(connectionStr); } catch (Exception exception) { throw new Exception("DBConnection Constructor:" + exception.Message); } } public DataSet Select() { try { if (connection != null) { connection.Open(); } string cmdStr = "Select * from t_family"; MySqlCommand sqlCmd = new MySqlCommand(cmdStr, connection); MySqlDataAdapter sda = new MySqlDataAdapter(sqlCmd); DataSet ds = new DataSet(); sda.Fill(ds, "t_family"); return ds; } catch (Exception exception) { throw new Exception("SelectMethod:" + exception.Message); } finally { connection.Close(); } } }以上代碼中提示“connection”沒(méi)有定義,怎么回事

單單這段代碼,,在我的VS中沒(méi)有任何錯(cuò)(只是沒(méi)有入口程序),你檢查下項(xiàng)目的其它部分。

文章評(píng)論