UPDATE: Problem solved; dear all with your help i just realized the problem and first i added ID column from db to datagridview as well i added a textbox to my formdesing. After that i just put "where" and "id" condition as below. Thanks you all!
string Query = "update doguAkdenizApp.team set id='" + this.txtEkipKayitNo.Text + "', name='" + this.txtEkipIsim.Text + "', surname='" + this.txtEkipSoyisim.Text + "', birth='" + this.dtpEkipDogum.Text + "', telephone='" + this.txtEkipTelefon.Text + "', email='" + this.txtEkipEposta.Text + "', city='" + this.cbEkipSehir.Text + "', adress='" + this.txtEkipAdres.Text + "', recorddate='"+this.dtpEkipDogum.Text+ "' where id='" + this.txtEkipKayitNo.Text + "';";
private void btnEkipGuncelle_Click(object sender, EventArgs e)
{ string myConnection = "datasource=root;port=root;username=root;password=root";
string Query = "update doguAkdenizApp.team set name='" + this.txtEkipIsim.Text + "', surname='" + this.txtEkipSoyisim.Text + "', birth='" + this.dtpEkipDogum.Text + "', telephone='" + this.txtEkipTelefon.Text + "', email='" + this.txtEkipEposta.Text + "', city='" + this.cbEkipSehir.Text + "', adress='" + this.txtEkipAdres.Text + "', recorddate='"+this.dtpEkipDogum.Text+"';";
MySqlConnection myConn = new MySqlConnection(myConnection);
MySqlCommand cmdDataBase = new MySqlCommand(Query, myConn);
MySqlDataReader myReader;
try
{
myConn.Open();
myReader = cmdDataBase.ExecuteReader();
MessageBox.Show("Güncelleme başarılı!"); //Update success notification
while (myReader.Read()) { }
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
loadTable();
clearAllTxt();*/
}
update doguAkdenizApp.team set name='' where some condition
You forgot the where condition.
Right now you write to update the whole rows in the table, if you will add a where condition like where id = 3
, then only the row with id (only for example) will be update