currentstuation.cs

来自「利用vs2008+sql2000开发的物资管理系统」· CS 代码 · 共 57 行

CS
57
字号
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Data.SqlClient;

namespace login
{
    public partial class currentstuation : Form
    {
        public currentstuation()
        {
            InitializeComponent();
        }


        private void select_Click(object sender, EventArgs e)
        {
            String constr = "Data Source=localhost; Initial Catalog=WZGL_20052070;Integrated Security=true";
            SqlConnection scon = new SqlConnection(constr);

            SqlDataAdapter sa = new SqlDataAdapter();

            SqlCommand storescommand = new SqlCommand();
            string s="select o.pName,outquantity,nowquantity,outstoretime,storetime,o.storage,nowstorequantity from room r,outstore o,store s where o.pName=r.pName and o.storage=s.storage ";
            
            storescommand.CommandText = s;
            storescommand.Connection = scon;

            sa.SelectCommand = storescommand;

            DataSet ds = new DataSet();

            sa.Fill(ds, "admin");

            dataGridView1.DataSource = ds.Tables["admin"];
        }

        private void button1_Click(object sender, EventArgs e)
        {
            //MainFrm mainform = new MainFrm();
            //mainform.Show();
            //this.Hide();
            this.Close();
        }

        private void currentstuation_Load(object sender, EventArgs e)
        {

        }

 
    }
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?