Ibatis. Net study Note 2-download, compile, and run npetshop)

Source: Internet
Author: User

Full range of original address: http://www.cnblogs.com/firstyi/archive/2007/10/11/921116.html

: Http://ibatis.apache.org/dotnetdownloads.cgi
The latest version of ibastis. NET is available.Source codeAnd npetshop examples (the example is old)

After downloading the npetshop example, since it was originally based on vs2003, there are some problems during compilation and running after opening it with vs2005 locally. The main problems and solutions are as follows:
1. Convert to vs2005
A. Open the npetshop. sln file and click "Next" as prompted for conversion.
B. After the conversion, you cannot find the WEB Project, delete the original web project, and add the existing website to npetshop. Web.

2. modify the configuration file
The simplest way is to directly modify Dao. config in the npetshop. web directory, as shown in the following statement:

< Datasource name = " Access " Connectionstring = " Provider = Microsoft. Jet. oledb.4.0; Data Source = F: \ study \ _ net \ framework \ ibatis. Net \ npetshop. web \ npetshop. MDB " />

Change the path to your own path.
PS: npetshop. mdb is an access file under the npetshop. web directory.

3. An error is reported during compilation: circular file reference is not allowed.
Due to the difference between vs2005 and vs2003, find the file: npetshop. web \ usercontrols \ catalog \ searchproduct. ascx.
SetCode:

<% @ Register tagprefix = " Uc1 " Tagname = " Topbar " SRC = " ../Topbar. ascx "   %>
<% @ Register tagprefix = " Uc1 " Tagname = " Banner " SRC = " ../Banner. ascx "   %>
<% @ Register tagprefix = " PC3 " Namespace = " Npetshop. Presentation. Controls " Assembly = " Npetshop. Presentation "   %>
< Uc1: banner ID = " Banner " Runat = " Server " > </ Uc1: banner >
< Uc1: topbar ID = " Topbar " Runat = " Server " > </ Uc1: topbar >

Modify:

<% @ Register tagprefix = " Uc1 " Tagname = " Topbar " SRC = " ../Topbar. ascx "   %>
<% @ Register tagprefix = " UC2 " Tagname = " Banner " SRC = " ../Banner. ascx "   %>
<% @ Register tagprefix = " PC3 " Namespace = " Npetshop. Presentation. Controls " Assembly = " Npetshop. Presentation "   %>
< UC2: banner ID = " Banner " Runat = " Server " > </ UC2: banner >
< Uc1: topbar ID = " Topbar " Runat = " Server " > </ Uc1: topbar >

This means that the same uc1 cannot appear.

4. An error is reported during running.
After performing the preceding operations, you should be able to access the Home Page. However, a system error may be reported during running. After one-step debugging, you must manually
Npetshop. Web project add reference, reference location: npetshop \ external-bin \ bytefx. mysqlclient. dll

In this way, the npetshop example should be able to run normally.

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.