Từ 1 tới 1 trên tổng số 1 kết quả

Đề tài: Nhờ trợ giúp lỗi kết nối từ form Admin đến thẻ Tài Khoản qua DataGridView

  1. #1
    Ngày gia nhập
    02 2023
    Bài viết
    2

    Mặc định Nhờ trợ giúp lỗi kết nối từ form Admin đến thẻ Tài Khoản qua DataGridView

    Click vào hình ảnh để lấy hình ảnh lớn

Tên:		1.jpg
Lần xem:	3
Size:		103.2 KB
ID:		75775
    Click vào hình ảnh để lấy hình ảnh lớn

Tên:		2.jpg
Lần xem:	4
Size:		110.0 KB
ID:		75776

    Xin chào tất cả mọi người!
    Mình mới vào làng nghề nhờ tất cả giúp đỡ nhé!
    Mình đang viết phần mềm về quản lý quán cà phê nhưng đang bị lỗi liên kết từ Form Admin đến thẻ Tài Khoản qua DataGridView ai biết giúp mình với nhé, mình xin cảm ơn nhiều. Đây là 4 Form và 2 hình ảnh mình đã load nên.

    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 CAFE
    {
    public partial class fAccountProfile : Form
    {
    public fAccountProfile()
    {
    InitializeComponent();
    }

    private void btnExti_Click(object sender, EventArgs e)
    {
    this.Close();
    }
    }
    }





    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 CAFE
    {
    public partial class fAdmin : Form
    {
    public fAdmin()
    {
    InitializeComponent();
    LoadAcountList();
    }
    void LoadAcountList()

    {
    string connectionSTR = @"Data Source=.\SQLEXPRESS;Initial Catalog=QLCAFE;Integrated Security=Truee";

    sqlConnection connection = new sqlConnection(connectionSTR);

    string query = "select * from dbo.ACCOUNT";

    connection.Open();

    sqlCommand command = new sqlCommand(query, connection);

    DataTable data = new DataTable();

    sqlDataAdapter adapter = new sqlDataAdapter(command);

    adapter.fill(data);

    connection.Close();

    dtgvAcount.DataSource = data;
    }
    }
    }





    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 CAFE
    {
    public partial class fLogin : Form
    {
    public fLogin()
    {
    InitializeComponent();
    }

    private void btnLogin_Click(object sender, EventArgs e)
    {
    fTableManager f = new fTableManager();
    this.Hide();
    f.ShowDialog();
    this.Show();
    }

    private void btnExit_Click(object sender, EventArgs e)
    {
    Application.Exit();
    }

    private void fLogin_FormClosing(object sender, FormClosingEventArgs e)
    {
    if (MessageBox.Show("Bạn có muốn thoát chương trình?","Thông Báo",MessageBoxButtons.OKCancel) != System.Windows.Forms.DialogResult.OK)
    {
    e.Cancel = true;
    }
    }
    }
    }





    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 CAFE
    {
    public partial class fTableManager : Form
    {
    public fTableManager()
    {
    InitializeComponent();
    }

    private void đăngXuấtToolStripMenuItem_Click(object sender, EventArgs e)
    {
    this.Close();
    }

    private void thôngTinCáNhânToolStripMenuItem_Click(object sender, EventArgs e)
    {
    fAccountProfile f = new fAccountProfile();
    f.ShowDialog();
    }

    private void adminToolStripMenuItem_Click(object sender, EventArgs e)
    {
    fAdmin f = new fAdmin();
    f.ShowDialog();
    }
    }
    }
    Đã được chỉnh sửa lần cuối bởi ninhvantung : 10-02-2023 lúc 08:16 PM. Lý do: thêm chữ vì thiếu sót

Quyền hạn của bạn

  • Bạn không thể gửi đề tài mới
  • Bạn không thể gửi bài trả lời
  • Bạn không thể gửi các đính kèm
  • Bạn không thể chỉnh sửa bài viết của bạn