VS2003:
WEB.CONFIG
<appSettings>
<add key="SQL_ConnectionString" value="Persist Security Info=True;User ID=sa;Initial Catalog=DDD;Data Source=SSS"/>
VB
strConStr = System.Configuration.ConfigurationSettings.AppSettings("SQL_ConnectionString").ToString()
VS2008:
WEB.CONFIG
<connectionStrings>
<add name="SQL_ConnectionString" connectionString="Persist Security Info=True;User ID=sa;Initial Catalog=DDD;Data Source=SSS"/>
VB
Imports System.Configuration
strConStr = ConfigurationManager.ConnectionStrings("SQL_ConnectionString").ConnectionString
沒有留言:
張貼留言