Click here to view and discuss this page in DocCommentXchange. In the future, you will be sent there automatically.

SQL Anywhere 11.0.1 (Français) » SQL Anywhere Server - Programming » SQL Anywhere Data Access APIs » SQL Anywhere ASP.NET Providers

 

Registering the SQL Anywhere ASP.NET providers

Your web application must be configured to use the SQL Anywhere ASP.NET providers and not the default providers. To register SQL Anywhere ASP.NET providers:

  • Add a reference to the iAnywhere.Web.Security assembly to your web site.

  • Add an entry for each provider to the <system.web> element in web.config file.

  • Add the name of the SQL Anywhere ASP.NET provider to the defaultProvider attribute in the application.

The provider database can store data for multiple applications. For each application, the applicationName attribute must be the same for each SQL Anywhere ASP.NET provider. If you do not specify an applicationName value, an identical name is assigned to each provider in the provider database.

To reference a previously registered connection string, replace the connectionString attribute with the connectionStringName attribute.

XML code sample for Membership Provider registration
<membership defaultProvider="SAMembershipProvider">
   <providers>
      <add name="SAMembershipProvider"
         type="iAnywhere.Web.Security.SAMembershipProvider"
         connectionStringName="MyConnectionString"
         applicationName="MyApplication"
         commandTimeout="30"
			      enablePasswordReset="true"
         enablePasswordRetrieval="false"
         maxInvalidPasswordAttempts="5"
         minRequiredNonalphanumericCharacters="1"
         minRequiredPasswordLength="7"
         passwordAttemptWindow="10"
         passwordFormat="Hashed"
         requiresQuestionAndAnswer="true"
         requiresUniqueEmail="true"
         passwordStrengthRegularExpression="" />
   </providers>
</membership>

For column descriptions, see Membership provider XML attributes.

XML code sample for Roles Provider registration
<roleManager enabled="true" defaultProvider="SARoleProvider">
   <providers>
      <add name="SARoleProvider"
         type="iAnywhere.Web.Security.SARoleProvider"
         connectionStringName="MyConnectionString"
         applicationName="MyApplication"
         commandTimeout="30" />
   </providers>
</roleManager>

For column descriptions, see Roles provider table schema.

XML code sample for Profiles Provider registration
<profile defaultProvider="SAProfileProvider">
   <providers>
      <add name="SAProfileProvider"
         type="iAnywhere.Web.Security.SAProfileProvider"
         connectionStringName="MyConnectionString"
         applicationName="MyApplication"
         commandTimeout="30" />
   </providers
      <properties>
         <add name="UserString" type="string"
            serializeAs="Xml" />
         <add name="UserObject" type="object"
            serializeAs="Binary" />
   </properties>
</profile>

For column descriptions, see Profile provider table schema.

XML code sample for Personalization Provider registration
<webParts>
   <personalization defaultProvider="SAPersonalizationProvider">
      <providers>
			   <add name="SAPersonalizationProvider"
         type="iAnywhere.Web.Security.SAPersonalizationProvider"
         connectionStringName="MyConnectionString"
         applicationName="MyApplication"
         commandTimeout="30" />
		    </providers>
   </personalization>
</webParts>

For column descriptions, see Web Part Personalization provider table schema.

XML code sample for Health Monitoring Provider registration

For more information about setting up health monitoring, see the Microsoft web page How To: Use Health Monitoring in ASP.NET 2.0 (http://msdn.microsoft.com/en-us/library/ms998306.aspx).

<healthMonitoring enabled="true">
	               ...
   <providers>
      <add name="SAWebEventProvider"
         type="iAnywhere.Web.Security.SAWebEventProvider"
         connectionStringName="MyConnectionString"
         commandTimeout="30"
         bufferMode="Notification" 
         maxEventDetailsLength="Infinite" /
   </providers>
                ...
</healthMonitoring>

For column descriptions, see Health Monitoring provider table schema.