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 Thaoluannhom1
{
public partial class Login : Form
{
public Login()
{
InitializeComponent();
}
public static string strchuoiketnoi = @"Data Source=DESKTOP-3IJENJJ;Initial Catalog=QLBANHANG;Integrated Security=True";
private void btndangnhap_Click(object sender, EventArgs e)
{
SqlConnection conn = new SqlConnection(strchuoiketnoi);
SqlDataAdapter sda = new SqlDataAdapter("select * from USER where username='" + txtuser.Text + "' and password='" + txtpass.Text + "'", conn);
DataTable dt = new DataTable();
sda.Fill(dt);
if (dt.Rows[0][0].ToString() == "1")
MessageBox.Show("Login thành công");
else MessageBox.Show("Fail");
}
}
}
trên là bộ code mình làm ko hiểu tại sao nó lại xảy ra cái lỗi này ace giúp mình vs



83% thành viên diễn đàn không hỏi bài tập, còn bạn thì sao?