• 大小: 0.07M
    文件类型: .zip
    金币: 1
    下载: 0 次
    发布日期: 2021-02-26
  • 语言: C#
  • 标签: DataGridView  数据  

资源简介

数据库为access数据库

资源截图

代码片段和文件信息

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

namespace WindowsFormsApplication51
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void Form1_Load(object sender EventArgs e)
        {
            this.dataGridView1.DataSource = dtshowdata();

        }
        string strcon = @“Provider=Microsoft.Jet.OLEDB.4.0;Data Source=da.mdb“;
        string strsql = “select * from data1“;
        private DataTable dtshowdata()
        {
            OleDbConnection con = new OleDbConnection(strcon);
            OleDbCommand cmd = new OleDbCommand(strsql con);
            con.Open();
            OleDbDataAdapter da = new OleDbDataAdapter(cmd);
            DataTable dt = new DataTable(

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2020-06-05 19:03  datagriview统计做统计\
     目录           0  2019-10-27 19:45  datagriview统计做统计\.vs\
     目录           0  2019-10-27 19:45  datagriview统计做统计\.vs\WindowsFormsApplication51\
     目录           0  2019-10-27 19:45  datagriview统计做统计\.vs\WindowsFormsApplication51\v14\
     文件       46592  2020-06-22 13:45  datagriview统计做统计\.vs\WindowsFormsApplication51\v14\.suo
     目录           0  2020-06-05 19:03  datagriview统计做统计\WindowsFormsApplication51\
     文件         189  2019-08-30 19:27  datagriview统计做统计\WindowsFormsApplication51\App.config
     文件        7801  2019-08-30 21:55  datagriview统计做统计\WindowsFormsApplication51\Form1.Designer.cs
     文件        3930  2019-08-30 21:57  datagriview统计做统计\WindowsFormsApplication51\Form1.cs
     文件        5817  2019-08-30 21:55  datagriview统计做统计\WindowsFormsApplication51\Form1.resx
     文件         537  2019-08-30 19:27  datagriview统计做统计\WindowsFormsApplication51\Program.cs
     目录           0  2020-06-05 19:03  datagriview统计做统计\WindowsFormsApplication51\Properties\
     文件        1358  2019-08-30 19:27  datagriview统计做统计\WindowsFormsApplication51\Properties\AssemblyInfo.cs
     文件        2863  2019-08-30 19:27  datagriview统计做统计\WindowsFormsApplication51\Properties\Resources.Designer.cs
     文件        5612  2019-08-30 19:27  datagriview统计做统计\WindowsFormsApplication51\Properties\Resources.resx
     文件        1112  2019-08-30 19:27  datagriview统计做统计\WindowsFormsApplication51\Properties\Settings.Designer.cs
     文件         249  2019-08-30 19:27  datagriview统计做统计\WindowsFormsApplication51\Properties\Settings.settings
     文件        3948  2019-08-30 19:38  datagriview统计做统计\WindowsFormsApplication51\WindowsFormsApplication51.csproj
     目录           0  2020-06-05 19:03  datagriview统计做统计\WindowsFormsApplication51\bin\
     目录           0  2020-06-22 13:41  datagriview统计做统计\WindowsFormsApplication51\bin\Debug\
     文件       13312  2019-08-30 21:57  datagriview统计做统计\WindowsFormsApplication51\bin\Debug\WindowsFormsApplication51.exe
     文件         189  2019-08-30 19:27  datagriview统计做统计\WindowsFormsApplication51\bin\Debug\WindowsFormsApplication51.exe.config
     文件       24064  2019-08-30 21:57  datagriview统计做统计\WindowsFormsApplication51\bin\Debug\WindowsFormsApplication51.pdb
     文件       22696  2020-06-22 13:44  datagriview统计做统计\WindowsFormsApplication51\bin\Debug\WindowsFormsApplication51.vshost.exe
     文件         189  2019-08-30 19:27  datagriview统计做统计\WindowsFormsApplication51\bin\Debug\WindowsFormsApplication51.vshost.exe.config
     文件         490  2018-02-19 20:12  datagriview统计做统计\WindowsFormsApplication51\bin\Debug\WindowsFormsApplication51.vshost.exe.manifest
     文件      327680  2019-09-22 09:58  datagriview统计做统计\WindowsFormsApplication51\bin\Debug\da.mdb
     目录           0  2020-06-05 19:03  datagriview统计做统计\WindowsFormsApplication51\obj\
     目录           0  2020-06-22 13:44  datagriview统计做统计\WindowsFormsApplication51\obj\Debug\
     文件        1464  2020-06-22 13:44  datagriview统计做统计\WindowsFormsApplication51\obj\Debug\DesignTimeResolveAssemblyReferences.cache
     文件        7256  2020-06-22 13:43  datagriview统计做统计\WindowsFormsApplication51\obj\Debug\DesignTimeResolveAssemblyReferencesInput.cache
............此处省略12个文件信息

评论

共有 条评论