ASP. NET2.0 enables ASPNETDB to support Access data centers

Source: Internet
Author: User

In general, ASP. in NET2.0, ASPNETDB uses SQL Express data transmission. Sometimes we need Access data transmission. This article describes how to make ASPNETDB support Access data transmission.

A component is actually released by microsoft.

The attachment contains a dll file and an mdb file. The dll file needs to be copied to your bin file, while the mdb file must be copied to your App_Data file.

Http://files.cnblogs.com/zzyyll2/Release.rar

 

Then, configure the settings in web. config, as shown in the following figure:

 

<Configuration xmlns = "http://schemas.microsoft.com/.NetConfiguration/v2.0">
<ConnectionStrings>
<Add name = "AccessFileName" connectionString = "~ /App_Data/ASPNetDB. mdb "providerName =" System. Data. OleDb "/>
</ConnectionStrings>
<System. web>
<Membership defaultProvider = "AccessMembershipProvider">
<Providers>
<Clear/>
<Add name = "AccessMembershipProvider"
Type = "Samples. AccessProviders. AccessMembershipProvider, SampleAccessProviders"
ConnectionStringName = "AccessFileName"
EnablePasswordRetrieval = "false"
EnablePasswordReset = "false"
RequiresUniqueEmail = "false"
RequiresQuestionAndAnswer = "false"
MinRequiredPasswordLength = "1"
MinRequiredNonalphanumericCharacters = "0"
ApplicationName = "SampleSite"
HashAlgorithmType = "SHA1"
PasswordFormat = "Hashed"/>
</Providers>
</Membership>
<WebParts>
<Personalization defaultProvider = "AccessPersonalizationProvider">
<Providers>
<Add name = "AccessPersonalizationProvider"
Type = "Samples. AccessProviders. AccessPersonalizationProvider, SampleAccessProviders"
ConnectionStringName = "AccessFileName"
ApplicationName = "SampleSite"/>
</Providers>
</Personalization>
</WebParts>
</System. web>
</Configuration>

 

The above generation is required. You can seat the above generation in your web. config.
After the above configuration, your asp.net protocol supports Access data

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.