zoukankan      html  css  js  c++  java
  • 连接access的语句

    using System;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.Data;
    using System.Drawing;
    using System.Linq;
    using System.Text;
    using System.Windows.Forms;
    using System.Data.OleDb;

    namespace accesslink
    {
    public partial class Form1 : Form
    {
    OleDbConnection objConnection;
    DataSet myds;
    int vrec;
    public Form1()
    {
    InitializeComponent();
    }
    private void linkdb()
    {
    string s = "Provider=Microsoft.Jet.oledb.4.0;data source=Student.mdb";
    objConnection = new OleDbConnection(s);
    objConnection.Open();
    }

    private void button1_Click(object sender, EventArgs e)
    {
    linkdb();
    string sql = "select * from 基本信息表";
    OleDbDataAdapter mydata = new OleDbDataAdapter(sql, objConnection);
    DataSet myds=new DataSet();
    vrec = mydata.Fill(myds, "基本信息表");
    dataGridView1.DataSource = myds.Tables["基本信息表"];
    }

    private void dataGridView1_CellContentClick(object sender, DataGridViewCellEventArgs e)
    {

    }

    private void Form1_Load(object sender, EventArgs e)
    {

    }
    }
    }

  • 相关阅读:
    MFC单文档中进行plc点云显示
    modbus发送和接收
    测试左移和测试右移
    2021软件测试笔试题
    202106月份总结测试开发面试题
    KuaiShou面试题
    阿拉伯数学手写体。
    GeminiScrollbar
    vue-core-video-player
    webpack
  • 原文地址:https://www.cnblogs.com/zhaoshunjie/p/3764668.html
Copyright © 2011-2022 走看看