- WebForms, .NET 4.61
I am having an issue where dates are not converting from strings.
public dsBookingActual GetBookingActualData(Int64 ozBookingID, string consultant, string screenViewed)
{
DbCommand dbCommand = db.GetStoredProcCommand("usp_GetBookingActualData");
db.AddInParameter(dbCommand, "@OzBookingID", DbType.Int64, ozBookingID);
db.AddInParameter(dbCommand, "@Consultant", DbType.String, consultant);
db.AddInParameter(dbCommand, "@ScreenViewed", DbType.String, screenViewed);
dsBookingActual dsBA = new dsBookingActual();
//LoadDataSet fails when the date is 29/01/2016
db.LoadDataSet(dbCommand, dsBA, new string[] { Constant.BOOKING_ACTUAL, "Passengers" });
return dsBA;
}
We are in AU so the date format is dd/mm/yyyy and converting dates of 29/01/2016 fail as it is being attempted as mm/dd/yyyy for instance and 29 is not a valid month.
I tracked it down to the fact that the language settings in the browser are set to US similair to this post.
We have a globailzation tag in system.web as:
<globalization culture="en-AU" requestEncoding="utf-8" responseEncoding="utf-8" uiCulture="en-AU" />
So my question is how do I prevent the culture changing across the request. I am guessing it involves not acknowledging or processing the "Accept-Language header in the HTTP Request" but I am unsure how to implement this.
Any pointers appreciated.