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 26 27
| 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 +
"','ville','" + statut.Text + "');";
SqlCommand MyCmd = new SqlCommand(InsertQ, connection);
MyCmd.ExecuteNonQuery();
connection.Close();
fillStations();
Page.ClientScript.RegisterStartupScript(this.GetType(), "callFindAddress", "function callFindAddress() { findAddress('" + adresse.Text + "','" + nmStation.Text +
"','" + latitude.Text + "','" + longitude.Text + "','" + emplacement.Text + "','" + prop.Text + "','" + tpProp.Text + "','" + statut.Text + "'); }");
go.Attributes.Add("onclick", "callFindAddress();");
}
catch (SqlException ex)
{
go.Attributes.Add("onclick", "javascript: return alert('Erreur :"+ex.ToString()+"');");
}
finally
{
connection.Close();
} |
Partager