Note that there are some explanatory texts on larger screens.

plurals
  1. POC# Connecting to Oracle DB DateTime formatting
    primarykey
    data
    text
    <p>I have a .Net webapp that is connecting to an Oracle backend. I have a base page which every page uses where I set my </p> <pre><code> protected override void OnPreInit(EventArgs e) { System.Globalization.CultureInfo cultureInfo = new System.Globalization.CultureInfo("en-CA"); // Creating the DateTime Information specific to our application. System.Globalization.DateTimeFormatInfo dateTimeInfo = new System.Globalization.DateTimeFormatInfo(); // Defining various date and time formats. dateTimeInfo.DateSeparator = "/"; dateTimeInfo.LongDatePattern = "dd-MMM-yyyy"; dateTimeInfo.ShortDatePattern = "dd-MMM-yyyy"; dateTimeInfo.MonthDayPattern = "dd/MM"; dateTimeInfo.LongTimePattern = "HH:mm"; dateTimeInfo.ShortTimePattern = "HH:mm"; dateTimeInfo.FullDateTimePattern = "dd-MMM-yyyy"; // Setting application wide date time format. cultureInfo.DateTimeFormat = dateTimeInfo; // Assigning our custom Culture to the application. //Application.CurrentCulture = cultureInfo; Thread.CurrentThread.CurrentCulture = cultureInfo; Thread.CurrentThread.CurrentUICulture = cultureInfo; base.OnPreInit(e); } </code></pre> <p>In my application I use an OracleDataAdapter to execute plain text queries on the database. I am filtering dates like so</p> <pre><code>"MyDateColumn" = '01-Jan-2000' </code></pre> <p>This works fine on my local. However when I get to the server the only dates that work in my filter are in the format</p> <pre><code>"MyDateColumn" = '2000 Jan 01' </code></pre> <p>What am I missing?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload