Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inserting data into date/time column fails #52

Closed
darrencomeau opened this issue Jan 21, 2019 · 1 comment
Closed

Inserting data into date/time column fails #52

darrencomeau opened this issue Jan 21, 2019 · 1 comment
Assignees
Labels
bug Something isn't working
Milestone

Comments

@darrencomeau
Copy link
Member

image

        public void CreateObservation(int Id, int AerodromeId, string UnprocessedData, string Notes, DateTime UtcObservationTimestamp, int Source, DateTime UtcRecordTimestamp)
        {
            var columns = new string[] { "[Id]", "[AerodromeId]", "[Unprocessed Data]" , "[Notes]", "[UTC Timestamp Of Observation]", "[Observation Source Id]", "[UTC Timestamp Of Record]" };
            var record = new object[] { new object[] { Id, AerodromeId, UnprocessedData, Notes, UtcObservationTimestamp, Source, UtcRecordTimestamp } };

            CreateObservation(columns, record);
        }

        public void CreateObservation(string[] columns, object[] records)
        {
            database.InsertData("Weather", "Observation", columns, records);
        }
@darrencomeau darrencomeau added the bug Something isn't working label Jan 21, 2019
@darrencomeau darrencomeau added this to To do in Version 1.n.n via automation Jan 21, 2019
@darrencomeau darrencomeau added this to the Version 1.0.0 milestone Sep 10, 2019
@darrencomeau darrencomeau self-assigned this Sep 19, 2019
@darrencomeau darrencomeau moved this from To do to In progress in Version 1.n.n Sep 20, 2019
@darrencomeau
Copy link
Member Author

Fixed - but if wanting to insert nanosecond precision into a datetime2 field you have to use VulcanAnalytics.DBTester.MsSqlDatabaseTester.DateTime2 instead of System.DateTime

Version 1.n.n automation moved this from In progress to Done Sep 22, 2019
darrencomeau added a commit that referenced this issue Sep 22, 2019
NB If trying to insert into DateTime2 or anything with sub millisecond precision use the class MsSqlDatabaseTester.DateTime2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Version 1.n.n
  
Done
Development

No branches or pull requests

1 participant