首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >在数据库中保存信息/在GUI窗口中显示这些信息。(Visual Studios)

问在数据库中保存信息/在GUI窗口中显示这些信息。(Visual Studios)
EN

Stack Overflow用户
提问于 2016-04-14 21:38:34
回答 1查看 65关注 0票数 0

我正在尝试制作一个房间请求程序,并有两个窗口,我需要连接到数据库(我知道怎么做)。这两个窗口分别称为紧急窗口和看门人窗口。我的问题是我不知道如何在数据库中存储信息。例如,假设某人作为紧急情况登录并发送请求,需要存储信息,一旦看门人登录,他就可以看到请求。到目前为止,我已经有了数据库,但不确定在不手动添加信息的情况下是否在其中存储信息。如果任何人有任何关于如何做到这一点的指南或链接,我将不胜感激!

紧急窗口代码:

​

代码语言:javascript
复制
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.SqlClient;

namespace LOGINPAGE
{
    public partial class EMERGENCY : Form
    {
        

        public EMERGENCY()
        {

            InitializeComponent();
        }

        void Fillcombo()
        {

        }

        private void EMERGENCY_Load(object sender, EventArgs e)
        {
// TODO: This line of code loads data into the 'roomInfoDataSet6.Table' table. You can move, or remove it, as needed.

        
        }

        private void xButton1_Click(object sender, EventArgs e)
        {
            this.Close();
            Application.Exit();
        }

        private void xButton2_Click(object sender, EventArgs e)
        {

        }

        private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
        {

        }

        private void Search_Click(object sender, EventArgs e)
        {

        }

    }

}

​

看门人代码:

​

代码语言:javascript
复制
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;

namespace LOGINPAGE
{
    public partial class JANITOR : Form
    {
        public JANITOR()
        {
            InitializeComponent();
        }

        private void label1_Click(object sender, EventArgs e)
        {

        }

        private void dataGridView1_CellContentClick(object sender, DataGridViewCellEventArgs e)
        {

        }

        private void JANITOR_Load(object sender, EventArgs e)
        {
            // TODO: This line of code loads data into the 'roomInfoDataSet3.Table' table. You can move, or remove it, as needed.
            this.tableTableAdapter.Fill(this.roomInfoDataSet3.Table);

        }

        private void xButton4_Click(object sender, EventArgs e)
        {

        }

        private void xButton2_Click(object sender, EventArgs e)
        {
            this.Close();
            Application.Exit();
        }
    }
}

​

EMERGENCY

JANITOR

EN

回答 1

Stack Overflow用户

发布于 2016-04-14 22:12:57

您可以使用Ms access db。

通过大量YouTube视频教程,您会发现从c#连接acess变得非常简单

我可以在it数据库中有一个由“保存紧急”按钮更新的表,而看门人的“加载紧急”按钮将用同一个表中的项填充数据网格视图,该表填充了第一个按钮。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/36624877

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档