1. About IBATIS and Ibatisnet
Ibatis is another o / r mapping solution, J2EE's O / R scheme is much more, compared with Hibernate, the biggest feature of Ibatis
It is a small, it is very fast. If you don't need too much complex feature, iBATIS is the easiest solution that can meet your requirements and flexibly
Decision.
Ibatisnet is the .NET version of Ibatis.
The main station of Ibatis and Ibatisnet is www.ibatis.com
2. Download http://www.ibatis.com/common/download.html This is of course quoted by ibatisnet.common.dll, ibatisnet.dataMapper.dll, ibatisnet.dataAccess.dll, etc.
There are some database connection drivers in your project, in "NPETSHOP EXAMPLE"
You can find it in the directory "Source / External-Bin /" in an example of application.
Let's practice the first Ibatisnet item 1. Database: Use SQLServer2000: Creating Table in Northwind Test
CREATE TABLE [Person] ([PER_ID] [int] NOT NULL, [PER_FIRST_NAME] [varchar] (40) COLLATE Chinese_PRC_CI_AS NOT NULL, [PER_LAST_NAME] [varchar] (40) COLLATE Chinese_PRC_CI_AS NOT NULL, [PER_BIRTH_DATE] [datetime] NOT NULL, [PER_WEIGHT_KG] [float] not null, [per_height_m] [float] not null)
2. Add a configuration file SQLMap.config (my understanding is: sqlmap.config is the configuration file read by the iBatisnet, temporarily don't know how to make ibatisn
ET read files to replace SQLMap.config) XML version = "1.0" encoding = "UTF-8"?> xsi: noNamespaceSchemaLocation = "SqlMapConfig.xsd"> Connectionstring = "Server = localhost; database = test; user ID = sa; password = 123; connection RESET = false; connections Lifetime = 5; MIN pool size = 1; Max pool size = 50 "/> database> 3. Join the mapping file Person.xml XML Version = "1.0" encoding = "UTF-8"?> TYPE = "ibatistest.person" /> alias> T. Server.mAppath ("SQLMap.xml"); DataGrid1.datasource = Mapper.instance (). QueryforList ("SELECTALL", NULL; DATAGRID1.DATABIND ();