我用 ado 将 windowsform 与 sql 连接起来,并在 datagridview 中接收数据
对于插入数据,我将文本框放入我的表单中,但我测试了它并放入了文本,而不是使用 sqlconnection(ado(connectionstring)) 将数据设置到 sql 中,我的布尔返回 false
private void btnsubmit_Click(object sender, EventArgs e)
{
if (ValidateInputs()) {
bool isSuccess = repository.insert(txtname.Text, txtfamily.Text, txtemail.Text, txtmobile.Text, (int)txtage.Value, txtadress.Text) ;
if (isSuccess == true)
{
MessageBox.Show("عملیت با موفقیت انجام شد", "success", MessageBoxButtons.OK, MessageBoxIcon.Information);
DialogResult = DialogResult.OK;
}
else {
MessageBox.Show("عملیات به چوخ رفت","failer",MessageBoxButtons.OK);
}
}