//private void WriteToDatabase(PostgreSQLCopyHelper<TestSuite> copyHelper, IEnumerable<TestSuite> entities) //{ // using (var connection = new NpgsqlConnection("Server=10.4.10.31;Port=5432;Database=QA_Automation;User Id=bta_dev;Password=Aut0*13Q;")) // { // connection.Open(); // copyHelper.SaveAll(connection, entities); // } //} public void CreateTestStep(TestStep tstep) { try { using (var connection = new NpgsqlConnection("Server=10.4.10.31;Port=5432;Database=qa_automation;User Id=bta_dev;Password=Aut0*13Q;")) { connection.Open(); string commandText = "INSERT INTO automation." + '"' + "ReportTestStep" + '"' + "(teststep_id" + "," + '"' + "testcase_id" + '"' + "," + '"' + "TestStep_Name" + '"' + "," + '"' + "TestStep_StartTime" + '"' + "," + '"' + "TestStep_EndTime" + '"' + "," + '"' + "TestStep_Input" + '"' + "," + '"' + "TestStep_Output" + '"' + "," + '"' + "TestStep_expectedResults" + '"' + "," + '"' + "TestStep_Status" + '"' + "," + '"' + "TestStep_errorMessage" + '"' + "," + '"' + "TestStep_imageContent" + '"' + "," + '"' + "images" + '"' + ") " + "VALUES('" + tstep.GetId() + "','" + tstep.GetTestCaseid() + "','" + tstep.GetTestStep() + "','" + tstep.GetStepStartTime() + "','" + tstep.GetStepEndTime() + "','" + tstep.GetInput() + "','" + tstep.GetOutput() + "','" + tstep.GetExpectedResult() + "','" + tstep.GetTestStepdbstatus() + "','" + tstep.GetErrorMessage() + "','" + tstep.GetImageContent() + "','" + tstep.GetImages() + "')"; NpgsqlCommand command = new NpgsqlCommand(commandText, connection); int result = command.ExecuteNonQuery(); } } catch (Exception ex) { } }