zoukankan      html  css  js  c++  java
  • 【C#学习笔记】读access2007

    using System;
    using System.Data.OleDb;
    
    namespace ConsoleApplication
    {
        class Program
        {
            static void Main(string[] args)
            {
                string strConnection = "Provider = Microsoft.ACE.OLEDB.12.0;";
                strConnection += @"Data Source = c:/Database1.accdb ";
                OleDbConnection con = new OleDbConnection(strConnection);
                con.Open();
    
                OleDbCommand com = con.CreateCommand();
                com.CommandText = "SELECT * FROM 表1";
    
                OleDbDataReader reader = com.ExecuteReader();
    
                while (reader.Read())
                {             
                    Console.WriteLine((string)reader["姓名"]+"  "+(int)reader["年龄"]+"  "+(string)reader["性别"]);
                }
                reader.Close();
                con.Close();
    
                Console.Read();
            }      
        }
    }
  • 相关阅读:
    css中!important的用法
    mysql分区
    js 随机生成信用卡号
    js argument
    lnmp
    php的mcrypt
    php gd
    php socket
    最优服务次序问题 水 NOJ1254
    众数问题 NOJ 1207
  • 原文地址:https://www.cnblogs.com/tiandsp/p/7440431.html
Copyright © 2011-2022 走看看