小编han*_*ock的帖子

在.NET成员资格中使用List类型的配置文件属性

我正在开发一个需要提供身份验证以及角色和配置文件管理的C#Webservice.我需要每个配置文件都有一个List类型的属性.web.config中的配置文件部分如下所示:

<profile defaultProvider="MyProfileProvider" enabled="true">
  <providers>
    <remove name="MyProfileProvider"/>
    <add connectionStringName="MySqlServer"
      applicationName="MyApp"
      name="MyProfileProvider"
      type="System.Web.Profile.SqlProfileProvider" />
  </providers>
  <properties>
    <add name="Websites" type="System.Collections.Generic.List&lt;String&gt;" serializeAs="Binary"/>
  </properties>
</profile> 
Run Code Online (Sandbox Code Playgroud)

但是,当我启动webservice并尝试访问该属性时,它返回以下错误:

System.Configuration.ConfigurationErrorsException:尝试加载此属性的类型导致以下错误:无法加载类型'System.Collections.Generic.List <String>'.(C:\ Projects\MyProject\web.config第58行)---> System.Web.HttpException:无法加载类型'System.Collections.Generic.List <String>'.

有没有办法为此目的使用通用集合?

c# membership web-services asp.net-membership asp.net-profiles

7
推荐指数
1
解决办法
2194
查看次数

使用SP克隆整个数据库

我试图找出这是否可能,但到目前为止我还没有找到任何好的解决方案.我想要实现的是编写一个可以克隆数据库但没有存储数据的存储过程.这意味着应包含所有表,视图,约束,键和索引,但不包含任何数据.可以吗?

sql database sql-server clone sql-server-2005

0
推荐指数
1
解决办法
194
查看次数