net_orm_grove的学习(一)

  利用Grove Tool Kit 连接NorthWind 并生成Customers、Orders、Employees实体类

1、ObjectOperator
    
      //实例化ObjectOperator类
      string conn=System.Configuration.ConfigurationSettings.AppSettings["strconnection"];
      Grove.ORM.ObjectOperator obj=new ObjectOperator(conn);

MethodDescription
InsertInsert an object into the data source
UpdateUpdate an object
RemoveDelete an object from the data source
RemoveChildsDelete child objects
RetrieveReturns an object from the data source
RetrieveChildsReturns child objects from the data source
GetDataReaderReturns an IDataReader from the data source
GetObjectSetReturns a collection of object values
GetObjectSourceReturns a DataSet which contain the data source of the object
GetCountReturns a records count of the data source
BeginTranscationBegins a transaction at the data source, if transactions are supported by the data source. 
CommitCommits the current transaction.
RollbackRolls back the current transaction.

2、ObjectQuery 类

      //实例化ObjectQuery ,返回对象的所有记录集
      ObjectQuery  query = new ObjectQuery (typeof(Customer),"");

 3、返回DataSet 数据集

        Grove.ORM.ObjectOperator obj=new ObjectOperator(conn);
        Grove.ORM.ObjectQuery query = new ObjectQuery (typeof(Customers),"");
        DataSet ds = obj.GetObjectSource(query);

4、返回ArrayList集合

       Grove.ORM.ObjectOperator obj=new ObjectOperator(conn);
       Grove.ORM.ObjectQuery query = new ObjectQuery (typeof(Customers),"");
       ArrayList al = obj.GetObjectSet(query);

5、返回IDataReader

      Grove.ORM.ObjectOperator obj=new ObjectOperator(conn);
      Grove.ORM.ObjectQuery query = new ObjectQuery (typeof(Customers),"");
      IDataReader dr = obj.GetDataReader(query);
 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值