zoukankan      html  css  js  c++  java
  • 数据集

    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.SqlClient;
    
    namespace WindowsFormsApplication1
    {
        public partial class Form1 : Form
        {
            public Form1()
            {
                InitializeComponent();
            }
    
            private void Form1_Load(object sender, EventArgs e)
            {
                DataSet ds = new DataSet();
    
                string strCon = "Data Source=ahxh-02;Initial Catalog=CarsInsurance;Integrated Security=True";
                SqlConnection connection = new SqlConnection(strCon);
                connection.Open();
    
                string strSql = "select * from dbo.CarsInformation";
                SqlDataAdapter adapter = new SqlDataAdapter(strSql, connection);
                adapter.Fill(ds);
    
    
                DataTable dt = ds.Tables[0];
    
    
                DataTable dt1 = new DataTable("CarInsurance");
    
                string strSql1 = "select * from dbo.CarInsurance";
                SqlDataAdapter adapter1 = new SqlDataAdapter(strSql1, connection);
                adapter1.Fill(dt1);
    
                ds.Tables.Add(dt1);
    
                this.dataGridView1.DataSource = ds.Tables[0];
                this.dataGridView2.DataSource = ds.Tables[1];
    
    
                this.dataGridView3.DataSource = dt1;
    
    
    
    
    
    
            }
    
           
        }
    }
  • 相关阅读:
    2021年2月4号
    2021年2月3号
    2021年2月2号
    2021年2月1日
    2021年1月31日
    2021年1月30日
    20171205xlVBA往返航班组合
    选择文件
    从VBA过渡到Python
    20171114xlVba选定单行记录并打印
  • 原文地址:https://www.cnblogs.com/ruishuang208/p/3078811.html
Copyright © 2011-2022 走看看