IBatis.Net study notes two - download, compile, run NPetShop

Download: http://ibatis.apache.org/dotnetdownloads.cgi
have the latest version of ibastis.net the source code, etc., as well as npetshop examples (examples older)

after downloading the example npetshop good, because the original is based on vs2003 version of the compiler, there are some issues running after local open with vs2005, the main problem and solution is as follows:
1, converted into vs2005 version
   a, directly open npetshop.sln file, follow the prompts has been click "Next" conversion
   b, can not find a web project after conversion, delete the original web project, and then added npetshop.web way by adding to existing sites

2, modify the configuration file
   the easiest way is to directly modify dao.config under npetshop.web directory , a statement as follows:
< datasource name = " access "  connectionstring = " provider=microsoft.jet.oledb.4.0;data source=f:"study"_net"框架"ibatis.net"npetshop"npetshop.web"npetshop.mdb " />
   The path where into your own path.
   ps: npetshop.mdb access a file, directory under npetshop.web

3, compile-time error: do not allow the cycle file references
   due vs2005 and vs2003 is quite different cause, find the file: npetshop.web "usercontrols" catalog "searchproduct . ascx
the following code:
<% @ register tagprefix = " uc1 "  tagname = " topbar "  src = " ../topbar.ascx "  %>
<% @ register tagprefix = " uc1 "  tagname = " banner "  src = " ../banner.ascx "  %>
<% @ register tagprefix = " cc1 "  namespace = " npetshop.presentation.controls "  assembly = " npetshop.presentation "  %>
< uc1:banner id = " banner "  runat = " server " ></ uc1:banner >
< uc1:topbar id = " topbar "  runat = " server " ></ uc1:topbar >
   changed to:
<% @ register tagprefix = " uc1 "  tagname = " topbar "  src = " ../topbar.ascx "  %>
<% @ register tagprefix = " uc2 "  tagname = " banner "  src = " ../banner.ascx "  %>
<% @ register tagprefix = " cc1 "  namespace = " npetshop.presentation.controls "  assembly = " npetshop.presentation "  %>
< uc2:banner id = " banner "  runat = " server " ></ uc2:banner >
< uc1:topbar id = " topbar "  runat = " server " ></ uc1:topbar >
Mainly not appear the same UC1

4, runtime error
   after the operation as above, should be able to enter the home, but the system may report an error when run through a single-step debugging, we found necessary to manually
npetshop.web add a reference, a reference position : npetshop "external-bin" bytefx.mysqlclient.dll

this way, an example of npetshop should be able to properly run the

original address: http://www.cnblogs.com/firstyi/archive/2007/08/16/858501.html

Reproduced in: https: //www.cnblogs.com/zyfking/archive/2009/01/19/1378504.html

Guess you like

Origin blog.csdn.net/weixin_34249367/article/details/93251753