How to download, compile and run NPetShop in iBATIS.Net Application
It is believed that many inexperienced people have no idea about how to download, compile and run NPetShop in iBATIS.Net application. Therefore, this paper summarizes the causes and solutions of the problem. Through this article, I hope you can solve this problem.
Download, compile, and run NPetShop for iBATIS.Net applications. First, let's start our preparatory work:
After downloading the example of NPetShop, since it was originally based on VS2003, there are some problems in compiling and running after opening it with VS2005 locally. The main problems and solutions are as follows:
1. Convert to the version of VS2005
A. Open the NPetshop.sln file directly and click "next" as prompted to convert it.
B. Cannot find the web project after conversion, delete the original web project, and then add the NPetshop.Web by adding the existing website
2. Modify the configuration file
The easiest way is to directly modify the dao.config in the NPetshop.Web directory, with the following statement:
< dataSource name= "Access" connectionString= "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=F:\ Study\ _ Net\ framework\ iBATIS.NET\ NPetshop\ NPetshop.Web\ npetshop.mdb" / >
Change the path to your own path.
PS:npetshop.mdb is an access file in the NPetshop.Web directory
3. Compilation Times error: circular file reference is not allowed
Due to the difference between VS2005 and VS2003, find the file: NPetshop.Web\ UserControls\ Catalog\ SearchProduct.ascx
The code will be as follows:
<% @ 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 >
Modified 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 >
The main reason is that the same uc1 cannot appear.
4. Error in running the Times
After pressing the above operation, you should be able to go to the home page, but the runtime may report a system error. Through single-step debugging, it is found that you need to give it manually.
Add reference to NPetShop.Web project, reference location: NPetshop\ External-bin\ ByteFX.MySqlClient.dll
In this way, the NPetShop example should work properly.
After reading the above, have you mastered how to download, compile and run NPetShop in iBATIS.Net applications? If you want to learn more skills or want to know more about it, you are welcome to follow the industry information channel, thank you for reading!