درود دوستان
وقتی یه سطر رو ویرایش میکنم، اگر بعد از ویرایش دوباره روی دکمه ویرایش کلیک کنم بازم همون سطر ویرایش میشه، در صورتی که من دیگه اون سطر رو انتخاب نکردم
باید چه کنم؟
مشکل از کجاست؟
برنامه سه لایه
ویژوال استودیو
سی شارپ
اس کیو ال
تصویر اول
تصویر دوم
تصویر سوم- ارسال اطلاعات برای ویرایشات
کد ExecuteCommand هم این هست
public bool ExecuteCommand(string command, List<SqlParameter> parameters)
{
SqlConnection myConnection = new SqlConnection();
myConnection.ConnectionString = connectionString;
SqlCommand myCommand = new SqlCommand();
myCommand.Connection = myConnection;
myCommand.CommandText = command;
foreach (SqlParameter param in parameters)
{
myCommand.Parameters.Add(param);
}
try
{
myConnection.Open();
int result = myCommand.ExecuteNonQuery();
myConnection.Close();
if (result > 0)
{
return true;
}
else
{
return false;
}
}
catch (Exception ex)
{
return false;
}
}