【经典】C#操作ACCESS数据库(创建,压缩,备份,恢复)

这篇博客详细介绍了如何使用C#进行ACCESS数据库的管理,包括创建数据库、压缩、备份和恢复等操作,同时讲解了ExecuteNonQuery()、ExecuteScalar()和ExecuteReader()这三个常用方法的运用。
摘要由CSDN通过智能技术生成

C#操作ACCESS数据库(创建,压缩,备份,恢复)ExecuteNonQuery(),ExecuteScalar(),ExecuteReader的用法

 

 

http://hi.baidu.com/zh%5Fagain/blog/item/dca265fc7d9f024cd7887d77.html

 

 

 

http://hi.baidu.com/9021616/blog/item/a9baeb236fffff41ad34def2.html

 

ExecuteScalar 函数功能 收藏
OleDbCommand.ExecuteScalar Method

MSDN 资料

Executes the query, and returns the first column of the first row in the result set returned by the query. Additional columns or rows are ignored.

Namespace: System.Data.OleDb
Assembly: System.Data (in system.data.dll)

用处: 查询数据库总记录数

        string querystr = "select count(*) From ConanMsg";
        OleDbCommand mycommand;
        mycommand = new OleDbCommand(querystr, myconn);
        int count = (int)mycommand.ExecuteScalar();
count里保存的就是总记录数.

 

本文来自CSDN博客,转载请标明出处:http://blog.csdn.net/hanxin2008/archive/2006/09/2

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值