Code 1<connectionStrings> 2 <add name="myconn" connectionString="data source=(local);initial catalog=Busdb;user id=sa;pwd=sa"/> 3 </connectionStrings> 4 5<profile defaultProvider="myp"> 6 <properties> 7 <add name="num" type="int" allowAnonymous="true" /> 8 </properties> 9 <providers>10 <add name="myp" type="System.Web.Profile.SqlProfileProvider" connectionStringName="myconn"/>11 </providers>12 </profile>13 <anonymousIdentification enabled="true"/>14 转载于:https://www.cnblogs.com/kofzhoubiwen/archive/2008/06/28/1231642.html