I am using a gridview in ASP.NET and I am loading it with a sql statement and I activate the function of selecting the row
<asp:GridView ID="GridView1" runat="server" AllowPaging="True" AutoGenerateColumns="False" BorderColor="Black" DataSourceID="SqlDataSource1" OnSelectedIndexChanged="GridView1_SelectedIndexChanged" BorderStyle="Groove" OnRowCommand="GridView1_RowCommand" Width="956px">
<Columns>
<asp:CommandField ShowSelectButton="True" />
<asp:BoundField DataField="PatientiID" HeaderText="PatientiID" SortExpression="PatientiID" />
<asp:BoundField DataField="OccurTime" HeaderText="OccurTime" SortExpression="OccurTime" />
<asp:BoundField DataField="AlarmFlag" HeaderText="AlarmFlag" SortExpression="AlarmFlag" />
<asp:BoundField DataField="AlarmSeverity" HeaderText="AlarmSeverity" SortExpression="AlarmSeverity" />
<asp:BoundField DataField="Description1" HeaderText="Description1" SortExpression="Description1" />
</Columns>
</asp:GridView>
and I try to get the OccurTime data with the following method
protected void GridView1_SelectedIndexChanged(object sender, EventArgs e)
{
int P = 0;
String Fecha;
GridViewRow row = GridView1.SelectedRow;
Label3.Text = row.Cells[1].Text;
Label2.Text = row.Cells[2].Text;
P = int.Parse(row.Cells[1].Text);
Fecha = row.Cells[2].Text;
Label4.Text = Fecha;
Grafica_Chart(P,Fecha);
}
I need to send the date in a string in the way '2007-05-08 12:35:00' to the Grafica_Chart method but it brings it to me '08 / 05/2007 12:35:00 p. m. '
How could that format change?