这是app.config或是web.config吧?可以直接用ConfigurationManager读取:string conStr = ConfigurationManager.ConnectionStrings["sqlString"].ConnectionString;