вот моя ошибка ![enter image description here](https://i.stack.imgur.com/FXLkh.jpg)
даже я пытался: dtp_ngaycap.Value
это все еще подтверждает эту ошибку.вот код CNcommands
класс
public bool CNcommands(string commandType,string tenchunha,string nguoidaidien, string chucvu, int soCMDN, DateTime ngaycap, string diachi, string masothue, string nguoithuhuong, string sotaikhoan,string nganhang,string sodienthoai, string diachiemail, string diachinganhang, int maCN)
{
if (commandType == "insert")
{
string insertCN = "INSERT INTO [QLThueNha].[dbo].[ChuNha][MaChuNha],[TenChuNha],[Nguoidaidien],[Chucvu],[SoCMND],[Ngaycap],[Diachi],[Masothue],[Nguoithuhuong],[Sotaikhoan],[Nganhang],[Sodienthoai],[DiachimailCN],[Diachinganhang])VALUES('" + tenchunha + "','" + nguoidaidien + "','" + chucvu + "','" + soCMDN + "','" + ngaycap + "','" + diachi + "','" + masothue + "','" + nguoithuhuong + "','" + sotaikhoan + "','" + nganhang + "','" + sodienthoai + "','" + diachiemail + "','" + diachinganhang + "')";
if (executeQuery(insertCN, ref rowAffect_) == true && rowAffect_ == 1)
{
return true;
}
return true;
}
else if (commandType == "update")
{
string updateCN = "UPDATE [QLThueNha].[dbo].[ChuNha] SET [TenChuNha] = '" + tenchunha + "',[Nguoidaidien] = '" + nguoidaidien + "',[Chucvu] = '" + chucvu + "',[SoCMND] = '" + soCMDN + "',[Ngaycap] = '" + ngaycap + "',[Diachi] = '" + diachi + "',[Masothue] = '" + masothue + "',[Nguoithuhuong] = '" + nguoithuhuong + "',[Sotaikhoan] = '" + sotaikhoan + "',[Nganhang] = '" + nganhang + "',[Sodienthoai] = '" + sodienthoai + "',[DiachimailCN] = '" + diachiemail + "',[Diachinganhang] = '" + diachinganhang + "' WHERE <Search Conditions,,>";
if (executeQuery(updateCN, ref rowAffect_) == true && rowAffect_ == 1)
{
return true;
}
return true;
}
else
{
return false;
}
//if (commandType == "delete")
//{
// string deleteCN = "SET [TenChuNha] = '" + tenchunha + "',[Nguoidaidien] = '" + nguoidaidien + "',[Chucvu] = '" + chucvu + "',[SoCMND] = '" + soCMDN + "',[Ngaycap] = '" + ngaycap + "',[Diachi] = '" + diachi + "',[Masothue] = '" + masothue + "',[Nguoithuhuong] = '" + nguoithuhuong + "',[Sotaikhoan] = '" + sotaikhoan + "',[Nganhang] = '" + nganhang + "',[Sodienthoai] = '" + sodienthoai + "',[DiachimailCN] = '" + diachiemail + "',[Diachinganhang] = '" + diachinganhang + "' WHERE <Search Conditions,,>";
// if (executeQuery(deleteCN, ref rowAffect_) == true && rowAffect_ == 1)
// {
// return true;
// }
//}
}