<output id="qn6qe"></output>

    1. <output id="qn6qe"><tt id="qn6qe"></tt></output>
    2. <strike id="qn6qe"></strike>

      亚洲 日本 欧洲 欧美 视频,日韩中文字幕有码av,一本一道av中文字幕无码,国产线播放免费人成视频播放,人妻少妇偷人无码视频,日夜啪啪一区二区三区,国产尤物精品自在拍视频首页,久热这里只有精品12

      C# 連接EXCEL 文本框保存輸入信息

      部分代碼:

      using System;
      using System.Collections.Generic;
      using System.ComponentModel;
      using System.Data;
      using System.Drawing;
      using System.Linq;
      using System.Text;
      using System.Threading.Tasks;
      using System.Windows.Forms;
      using System.Data.OleDb;
      
      namespace WindowsFormsApp8
      {
          public partial class Form1 : Form
          {
              public Form1()
              {
                  InitializeComponent();
              }
      
              private void button1_Click(object sender, EventArgs e)
              {
                  string Path = textBox1.Text.Trim();
                  string sql = textBox2.Text.Trim();
                  //string connStr = "Provider=Microsoft.Jet.OLEDB.4.0;" + "Data Source=" + Path + ";" + "Extended Properties=Excel 8.0;";
                  string connStr = "Provider=Microsoft.ACE.OLEDB.12.0;" + "Data Source=" + Path + ";" + "Extended Properties=Excel 8.0;";
                  OleDbConnection conn = new OleDbConnection(connStr);
                  conn.Open();
                  OleDbDataAdapter myCommand = null;
                  DataSet ds = null;
                  myCommand = new OleDbDataAdapter(sql, connStr);
                  ds = new DataSet();
                  myCommand.Fill(ds, "table1");
      
                  dataGridView1.DataSource = ds.Tables[0];
                  //dataGridView1.Columns["username"].Visible = false;
                  //dataGridView1.RowHeadersVisible = false;
                  //button2.Enabled = false;
                  dataGridView1.Columns["UserId"].ReadOnly = true;
                  conn.Close();
              }
      
           
      
              private void Form1_Load(object sender, EventArgs e)
              {
                  textBox1.Text = Properties.Settings.Default.defaultPath;
                  textBox2.Text = Properties.Settings.Default.defaultSQL;
              }
      
              private void Form1_FormClosing(object sender, FormClosingEventArgs e)
              {
                  Properties.Settings.Default.defaultPath = textBox1.Text.Trim();
                  Properties.Settings.Default.defaultSQL = textBox2.Text.Trim();
                  Properties.Settings.Default.Save();
              }
      
              private void button2_Click(object sender, EventArgs e)
              {
                  string msg = string.Format("第{0}行,第{1}列", dataGridView1.CurrentCell.RowIndex,
                      dataGridView1.CurrentCell.ColumnIndex);
                  richTextBox1.Text = msg+"\n值為:"+dataGridView1.CurrentCell.Value.ToString();
              }
          }
      }

       

      posted @ 2023-04-30 12:57  竹樓風雨聲  閱讀(51)  評論(0)    收藏  舉報
      主站蜘蛛池模板: 中文字幕亚洲资源网久久| 呦系列视频一区二区三区| 久久精品国产亚洲av天海翼| 亚洲国产高清第一第二区| 在线看无码的免费网站| 亚洲肥熟女一区二区三区| 在线观看热码亚洲AV每日更新| 国产日产免费高清欧美一区| 成人看的污污超级黄网站免费 | 东方av四虎在线观看| 日本肥老妇色xxxxx日本老妇| 老子午夜精品888无码不卡| 少妇人妻真实偷人精品| 久章草在线精品视频免费观看| 黑人强伦姧人妻久久| 深夜福利啪啪片| 国产精品无遮挡猛进猛出| 99久久婷婷国产综合精品青草漫画 | 久久这里只精品热免费99| 亚洲AV无码专区亚洲AV桃| 在线观看国产一区亚洲bd | 亚洲顶级裸体av片| 亚洲中文字幕有综合久久| 国产一区二区av天堂热| 天堂一区二区三区av| 精品激情视频一区二区三区| 免费无码又爽又刺激网站直播| 精品无码国产自产拍在线观看蜜 | 亚洲综合中文字幕第一页| 亚洲深深色噜噜狠狠网站| 91孕妇精品一区二区三区| 成人区精品一区二区不卡| 日产精品久久久久久久| 国产一区二区三区四区激情| 岛国岛国免费v片在线观看| 久久夜色撩人精品国产小说| 九九热免费在线视频观看| 麻豆国产va免费精品高清在线| 制服丝袜中文字幕在线| 亚洲中文字幕精品第三区| A毛片终身免费观看网站|