• 大小: 656KB
    文件类型: .rar
    金币: 1
    下载: 0 次
    发布日期: 2021-05-31
  • 语言: C#
  • 标签: IBatisNet  C#  Oracle10g  

资源简介

本实例使用C#调用IBatisNet连接操作Oracle10g的实例,使得初学者少起弯路;下载后直接编译使用。 注: 必须安装oracle10g客户端,并且配置数据库连接 创建表t_test create table t_test( id int);

资源截图

代码片段和文件信息

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Collections;

using IBatisNet.Common;
using IBatisNet.DataAccess;
using IBatisNet.DataMapper;
using ConsoleApplication1.da;

namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
            Console.WriteLine(“--begin--“);
            try
            {
                RfidReaderDA da = new RfidReaderDA();
                IList readers = da.getAll();
                foreach (tb_test r in readers)
                {
                    //print id
                    Console.WriteLine(“id =“ + r.id);
                    Console.WriteLine(““);
                }
                Console.WriteLine(“--insert data--“);
                tb_test rf = new tb_test();
                rf.id = 4;
                da.insReader(rf);
                readers = da.getAll();
                foreach (tb_test r in readers)
                {
                    //
                    Console.WriteLine(“id =“ + r.id);
                    Console.WriteLine(““);
                }
            }
            catch(Exception ec)
            {
                Console.WriteLine(“Error:“+ec.Message);
            }

            Console.WriteLine(“--end--“);
            Console.ReadLine();

        }
    }
    
}

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件        745  2013-06-24 10:58  C#_Conn_Ora\ConsoleApplication1\App.config

     文件      73728  2008-03-19 21:10  C#_Conn_Ora\ConsoleApplication1\bin\Release\Castle.DynamicProxy.dll

     文件       6656  2013-09-03 13:27  C#_Conn_Ora\ConsoleApplication1\bin\Release\ConsoleApplication1.exe

     文件        745  2013-06-24 10:58  C#_Conn_Ora\ConsoleApplication1\bin\Release\ConsoleApplication1.exe.config

     文件      15872  2013-09-03 13:27  C#_Conn_Ora\ConsoleApplication1\bin\Release\ConsoleApplication1.pdb

     文件      11600  2013-09-03 13:27  C#_Conn_Ora\ConsoleApplication1\bin\Release\ConsoleApplication1.vshost.exe

     文件        745  2013-06-24 10:58  C#_Conn_Ora\ConsoleApplication1\bin\Release\ConsoleApplication1.vshost.exe.config

     文件        490  2010-03-17 22:39  C#_Conn_Ora\ConsoleApplication1\bin\Release\ConsoleApplication1.vshost.exe.manifest

     文件     102400  2008-11-01 12:04  C#_Conn_Ora\ConsoleApplication1\bin\Release\IBatisNet.Common.dll

     文件      57344  2008-11-01 12:04  C#_Conn_Ora\ConsoleApplication1\bin\Release\IBatisNet.DataAccess.dll

     文件     266240  2008-11-01 12:04  C#_Conn_Ora\ConsoleApplication1\bin\Release\IBatisNet.DataMapper.dll

     文件     266240  2013-02-28 15:27  C#_Conn_Ora\ConsoleApplication1\bin\Release\log4net.dll

     文件        741  2013-09-03 13:25  C#_Conn_Ora\ConsoleApplication1\bin\Release\mapper\tb_test.xml

     文件       1833  2013-09-03 11:16  C#_Conn_Ora\ConsoleApplication1\bin\Release\Providers.config

     文件        648  2013-09-03 13:19  C#_Conn_Ora\ConsoleApplication1\bin\Release\SqlMap.config

     文件       6193  2013-09-03 13:27  C#_Conn_Ora\ConsoleApplication1\ConsoleApplication1.csproj

     文件        478  2013-06-24 10:58  C#_Conn_Ora\ConsoleApplication1\ConsoleApplication1.csproj.user

     文件       1168  2013-09-03 13:22  C#_Conn_Ora\ConsoleApplication1\da\DBDA.cs

     文件      73728  2008-03-19 21:10  C#_Conn_Ora\ConsoleApplication1\dll\Castle.DynamicProxy.dll

     文件     102400  2008-11-01 12:04  C#_Conn_Ora\ConsoleApplication1\dll\IBatisNet.Common.dll

     文件      57344  2008-11-01 12:04  C#_Conn_Ora\ConsoleApplication1\dll\IBatisNet.DataAccess.dll

     文件     266240  2008-11-01 12:04  C#_Conn_Ora\ConsoleApplication1\dll\IBatisNet.DataMapper.dll

     文件     266240  2013-02-28 15:27  C#_Conn_Ora\ConsoleApplication1\dll\log4net.dll

     文件     647168  2006-10-11 14:25  C#_Conn_Ora\ConsoleApplication1\dll\Oracle.DataAccess.dll

     文件        741  2013-09-03 13:25  C#_Conn_Ora\ConsoleApplication1\mapper\tb_test.xml

     文件          0  2013-06-24 10:52  C#_Conn_Ora\ConsoleApplication1\obj\Debug\build.force

     文件       1410  2013-06-24 10:52  C#_Conn_Ora\ConsoleApplication1\obj\Debug\ConsoleApplication1.csproj.FileListAbsolute.txt

     文件       7680  2013-06-24 10:51  C#_Conn_Ora\ConsoleApplication1\obj\Debug\ConsoleApplication1.exe

     文件      17920  2013-06-24 10:51  C#_Conn_Ora\ConsoleApplication1\obj\Debug\ConsoleApplication1.pdb

     文件       4735  2013-09-03 13:27  C#_Conn_Ora\ConsoleApplication1\obj\Release\ConsoleApplication1.csproj.FileListAbsolute.txt

............此处省略30个文件信息

评论

共有 条评论