As Bryian Tan has indicated the line
return fecha.ToString("yyyy-MM-dd HH':'mm':'ss");
is incorrect. It could be
return fecha.ToString("yyyy-MM-dd HH:mm:ss");
or potentially
return fecha.ToString("u");
if you use the
Standard Date and Time Format Strings[
^]
However, instead of constructing the command using string.format (which can leave you susceptible to sql injection attacks) why not utilise SqlParameters (
SqlParameter Class (System.Data.SqlClient)[
^])
Something like ...(untested)
var cmd = New SqlCommand("Execute SpInsertar_Cliente @Client, @RasonSocail, @Aniversario, @Bloqueado");
cmd.Parameters.AddWithValue("@Client", this.Txt_Id_Cliente);
cmd.Parameters.AddWithValue("@RasonSocail",this.Txt_RasonSocial.Text.Trim());
cmd.Parameters.AddWithValue("@Aniversario", DTP_Aniversario.Value);
cmd.Parameters.AddWithValue("@Blqueado",this.CkB_Bloqueado.Checked);