web.config关键字代码:
<configuration>    <appSettings>
       <add key="mydb" value="server=(local);uid=sa;database=wxyy"></add>
   </appSettings>
 
</configuration>
引用代码:
dim conn as string
conn=ConfigurationSettings.AppSettings["mydb"].tostring()dim cn as new sqlconnection(conn);
cn.open();
测试出现错误信息:
 BC30311: 类型“System.Collections.Specialized.NameValueCollection”的值无法转换为“String”。
出错行是:conn=ConfigurationSettings.AppSettings["mydb"].tostring()
请教高手!万分感谢!!!!!!!