1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
| protected void go_Click(object sender, EventArgs e)
{
ModalPopupExtender1.Hide();
try
{
connection.Open();
string InsertQ = "INSERT INTO dbo.StationsServices(Name_station,Latitude,Longitude,Emplacement,Propriétaire,Type_Prop,Adresse,Ville,Statut) VALUES('"
+ nmStation.Text + "', '" + latitude.Text + "','" + longitude.Text + "','" + emplacement.Text + "','" + prop.Text + "','" + tpProp.Text + "','" + adresse.Text +
"','" + statut.Text + "');";
SqlCommand MyCmd = new SqlCommand(InsertQ, connection);
MyCmd.ExecuteNonQuery();
connection.Close();
fillStations();
//go.Attributes.Add("onclick", "javascript: return alert('Station enregistrée');");
}
catch (SqlException ex)
{
//go.Attributes.Add("onclick", "javascript: return alert('Erreur :"+ex.ToString()+"');");
}
finally
{
connection.Close();
}
} |
Partager