From 5882c5c8e2d80c5b624ca812fbc803a69790306f Mon Sep 17 00:00:00 2001 From: gvasquezvargas Date: Thu, 23 Jan 2025 16:12:33 +0100 Subject: [PATCH 1/3] NET connector: docs version consolidation --- .../docs/net_connector/4.0.10.1/index.mdx | 16 - .../net_connector/4.0.10.2/01_whats_new.mdx | 13 - .../4.0.10.2/02_requirements_overview.mdx | 30 -- ...advanced_server_net_connector_overview.mdx | 38 -- ...ling_and_configuring_the_net_connector.mdx | 414 --------------- .../4.0.10.2/05_using_the_net_connector.mdx | 27 - .../06_opening_a_database_connection.mdx | 288 ---------- .../07_retrieving_database_records.mdx | 133 ----- .../4.0.10.2/08_parameterized_queries.mdx | 66 --- .../09_inserting_records_in_a_database.mdx | 71 --- .../10_deleting_records_in_a_database.mdx | 72 --- ...red_procedures_in_your_net_application.mdx | 420 --------------- .../4.0.10.2/12_using_advanced_queueing.mdx | 492 ----------------- ...sing_a_ref_cursor_in_a_net_application.mdx | 110 ---- .../4.0.10.2/14_using_plugins.mdx | 210 -------- .../4.0.10.2/15_using_object_types.mdx | 187 ------- .../4.0.10.2/16_scram_compatibility.mdx | 13 - ..._advanced_server_net_connector_logging.mdx | 104 ---- .../4.0.10.2/18_api_reference.mdx | 16 - .../images/connection_opened_successfully.png | 3 - .../net_connector/4.0.10.2/images/dialog.png | 3 - .../images/dotnet_installation_complete.png | 3 - .../images/dotnet_installation_dialog.png | 3 - .../images/dotnet_installation_wizard.png | 3 - .../4.0.10.2/images/ready_to_install.png | 3 - .../selecting_the_connectors_installer.png | 3 - .../images/starting_stackbuilder_plus.png | 3 - .../docs/net_connector/4.0.10.2/index.mdx | 29 - .../docs/net_connector/4.0.6.1/index.mdx | 16 - .../docs/net_connector/4.1.3.1/index.mdx | 16 - .../docs/net_connector/4.1.5.1/index.mdx | 16 - .../4.1.6.1/02_requirements_overview.mdx | 30 -- ...advanced_server_net_connector_overview.mdx | 39 -- ...ling_and_configuring_the_net_connector.mdx | 494 ------------------ .../4.1.6.1/05_using_the_net_connector.mdx | 27 - .../06_opening_a_database_connection.mdx | 288 ---------- .../07_retrieving_database_records.mdx | 133 ----- .../4.1.6.1/08_parameterized_queries.mdx | 66 --- .../09_inserting_records_in_a_database.mdx | 71 --- .../10_deleting_records_in_a_database.mdx | 72 --- ...red_procedures_in_your_net_application.mdx | 420 --------------- .../4.1.6.1/12_using_advanced_queueing.mdx | 492 ----------------- ...sing_a_ref_cursor_in_a_net_application.mdx | 108 ---- .../4.1.6.1/14_using_plugins.mdx | 256 --------- .../4.1.6.1/15_using_object_types.mdx | 190 ------- .../4.1.6.1/16_scram_compatibility.mdx | 13 - ..._advanced_server_net_connector_logging.mdx | 107 ---- .../4.1.6.1/18_api_reference.mdx | 16 - .../images/connection_opened_successfully.png | 3 - .../net_connector/4.1.6.1/images/dialog.png | 3 - .../images/dotnet_installation_complete.png | 3 - .../images/dotnet_installation_dialog.png | 3 - .../images/dotnet_installation_wizard.png | 3 - .../4.1.6.1/images/ready_to_install.png | 3 - .../selecting_the_connectors_installer.png | 3 - .../images/starting_stackbuilder_plus.png | 3 - .../docs/net_connector/4.1.6.1/index.mdx | 28 - .../5.0.7.1/02_requirements_overview.mdx | 24 - ...advanced_server_net_connector_overview.mdx | 35 -- ...ling_and_configuring_the_net_connector.mdx | 260 --------- .../5.0.7.1/05_using_the_net_connector.mdx | 24 - .../06_opening_a_database_connection.mdx | 275 ---------- .../07_retrieving_database_records.mdx | 120 ----- .../5.0.7.1/08_parameterized_queries.mdx | 59 --- .../09_inserting_records_in_a_database.mdx | 64 --- .../10_deleting_records_in_a_database.mdx | 65 --- ...red_procedures_in_your_net_application.mdx | 409 --------------- .../5.0.7.1/12_using_advanced_queueing.mdx | 490 ----------------- ...sing_a_ref_cursor_in_a_net_application.mdx | 105 ---- .../5.0.7.1/14_using_plugins.mdx | 89 ---- .../5.0.7.1/15_using_object_types.mdx | 185 ------- .../5.0.7.1/16_scram_compatibility.mdx | 10 - ..._advanced_server_net_connector_logging.mdx | 104 ---- .../5.0.7.1/18_api_reference.mdx | 13 - .../images/connection_opened_successfully.png | 3 - .../net_connector/5.0.7.1/images/dialog.png | 3 - .../images/dotnet_installation_complete.png | 3 - .../images/dotnet_installation_dialog.png | 3 - .../images/dotnet_installation_wizard.png | 3 - .../5.0.7.1/images/ready_to_install.png | 3 - .../selecting_the_connectors_installer.png | 3 - .../images/starting_stackbuilder_plus.png | 3 - .../docs/net_connector/5.0.7.1/index.mdx | 20 - .../6.0.2.1/02_requirements_overview.mdx | 20 - ...advanced_server_net_connector_overview.mdx | 36 -- ...ling_and_configuring_the_net_connector.mdx | 269 ---------- .../6.0.2.1/05_using_the_net_connector.mdx | 24 - .../06_opening_a_database_connection.mdx | 279 ---------- .../07_retrieving_database_records.mdx | 120 ----- .../6.0.2.1/08_parameterized_queries.mdx | 59 --- .../09_inserting_records_in_a_database.mdx | 64 --- .../10_deleting_records_in_a_database.mdx | 65 --- ...red_procedures_in_your_net_application.mdx | 409 --------------- .../6.0.2.1/12_using_advanced_queueing.mdx | 490 ----------------- ...sing_a_ref_cursor_in_a_net_application.mdx | 105 ---- .../6.0.2.1/14_using_plugins.mdx | 64 --- .../6.0.2.1/15_using_object_types.mdx | 185 ------- .../6.0.2.1/16_scram_compatibility.mdx | 10 - ..._advanced_server_net_connector_logging.mdx | 104 ---- .../6.0.2.1/18_api_reference.mdx | 13 - .../images/connection_opened_successfully.png | 3 - .../net_connector/6.0.2.1/images/dialog.png | 3 - .../images/dotnet_installation_complete.png | 3 - .../images/dotnet_installation_dialog.png | 3 - .../images/dotnet_installation_wizard.png | 3 - .../6.0.2.1/images/ready_to_install.png | 3 - .../selecting_the_connectors_installer.png | 3 - .../images/starting_stackbuilder_plus.png | 3 - .../docs/net_connector/6.0.2.1/index.mdx | 20 - .../7.0.4.1/02_requirements_overview.mdx | 20 - ...advanced_server_net_connector_overview.mdx | 41 -- ...ling_and_configuring_the_net_connector.mdx | 268 ---------- .../7.0.4.1/05_using_the_net_connector.mdx | 24 - .../06_opening_a_database_connection.mdx | 278 ---------- .../07_retrieving_database_records.mdx | 102 ---- .../7.0.4.1/08_parameterized_queries.mdx | 47 -- .../09_inserting_records_in_a_database.mdx | 47 -- .../10_deleting_records_in_a_database.mdx | 44 -- ...red_procedures_in_your_net_application.mdx | 340 ------------ .../7.0.4.1/12_using_advanced_queueing.mdx | 492 ----------------- ...sing_a_ref_cursor_in_a_net_application.mdx | 104 ---- .../7.0.4.1/14_using_plugins.mdx | 55 -- .../7.0.4.1/15_using_object_types.mdx | 181 ------- .../7.0.4.1/16_scram_compatibility.mdx | 10 - ..._advanced_server_net_connector_logging.mdx | 82 --- .../7.0.4.1/18_api_reference.mdx | 13 - .../images/connection_opened_successfully.png | 3 - .../net_connector/7.0.4.1/images/dialog.png | 3 - .../images/dotnet_installation_complete.png | 3 - .../images/dotnet_installation_dialog.png | 3 - .../images/dotnet_installation_wizard.png | 3 - .../7.0.4.1/images/ready_to_install.png | 3 - .../selecting_the_connectors_installer.png | 3 - .../images/starting_stackbuilder_plus.png | 3 - .../docs/net_connector/7.0.4.1/index.mdx | 20 - .../7.0.6.1/02_requirements_overview.mdx | 20 - ...advanced_server_net_connector_overview.mdx | 40 -- ...ling_and_configuring_the_net_connector.mdx | 274 ---------- .../7.0.6.1/05_using_the_net_connector.mdx | 24 - .../06_opening_a_database_connection.mdx | 278 ---------- .../07_retrieving_database_records.mdx | 102 ---- .../7.0.6.1/08_parameterized_queries.mdx | 47 -- .../09_inserting_records_in_a_database.mdx | 47 -- .../10_deleting_records_in_a_database.mdx | 44 -- ...red_procedures_in_your_net_application.mdx | 340 ------------ .../7.0.6.1/12_using_advanced_queueing.mdx | 492 ----------------- ...sing_a_ref_cursor_in_a_net_application.mdx | 104 ---- .../7.0.6.1/14_using_plugins.mdx | 72 --- .../7.0.6.1/15_using_object_types.mdx | 181 ------- .../7.0.6.1/16_scram_compatibility.mdx | 10 - ..._advanced_server_net_connector_logging.mdx | 82 --- .../7.0.6.1/18_api_reference.mdx | 13 - .../images/connection_opened_successfully.png | 3 - .../net_connector/7.0.6.1/images/dialog.png | 3 - .../images/dotnet_installation_complete.png | 3 - .../images/dotnet_installation_dialog.png | 3 - .../images/dotnet_installation_wizard.png | 3 - .../7.0.6.1/images/ready_to_install.png | 3 - .../selecting_the_connectors_installer.png | 3 - .../images/starting_stackbuilder_plus.png | 3 - .../docs/net_connector/7.0.6.1/index.mdx | 20 - .../7.0.6.2/02_requirements_overview.mdx | 20 - ...advanced_server_net_connector_overview.mdx | 40 -- ...ling_and_configuring_the_net_connector.mdx | 274 ---------- .../7.0.6.2/05_using_the_net_connector.mdx | 24 - .../06_opening_a_database_connection.mdx | 278 ---------- .../07_retrieving_database_records.mdx | 102 ---- .../7.0.6.2/08_parameterized_queries.mdx | 47 -- .../09_inserting_records_in_a_database.mdx | 47 -- .../10_deleting_records_in_a_database.mdx | 44 -- ...red_procedures_in_your_net_application.mdx | 340 ------------ .../7.0.6.2/12_using_advanced_queueing.mdx | 492 ----------------- ...sing_a_ref_cursor_in_a_net_application.mdx | 104 ---- .../7.0.6.2/14_using_plugins.mdx | 72 --- .../7.0.6.2/15_using_object_types.mdx | 181 ------- .../7.0.6.2/16_scram_compatibility.mdx | 10 - ..._advanced_server_net_connector_logging.mdx | 82 --- .../7.0.6.2/18_api_reference.mdx | 13 - .../images/connection_opened_successfully.png | 3 - .../net_connector/7.0.6.2/images/dialog.png | 3 - .../images/dotnet_installation_complete.png | 3 - .../images/dotnet_installation_dialog.png | 3 - .../images/dotnet_installation_wizard.png | 3 - .../7.0.6.2/images/ready_to_install.png | 3 - .../selecting_the_connectors_installer.png | 3 - .../images/starting_stackbuilder_plus.png | 3 - .../docs/net_connector/7.0.6.2/index.mdx | 20 - .../8.0.2.1/02_requirements_overview.mdx | 20 - ...advanced_server_net_connector_overview.mdx | 41 -- ...ling_and_configuring_the_net_connector.mdx | 320 ------------ .../8.0.2.1/05_using_the_net_connector.mdx | 24 - .../06_opening_a_database_connection.mdx | 278 ---------- .../07_retrieving_database_records.mdx | 102 ---- .../8.0.2.1/08_parameterized_queries.mdx | 47 -- .../09_inserting_records_in_a_database.mdx | 47 -- .../10_deleting_records_in_a_database.mdx | 44 -- ...red_procedures_in_your_net_application.mdx | 340 ------------ .../8.0.2.1/12_using_advanced_queueing.mdx | 492 ----------------- ...sing_a_ref_cursor_in_a_net_application.mdx | 104 ---- .../8.0.2.1/14_using_plugins.mdx | 72 --- .../8.0.2.1/15_using_object_types.mdx | 181 ------- .../8.0.2.1/16_scram_compatibility.mdx | 10 - ..._advanced_server_net_connector_logging.mdx | 82 --- .../8.0.2.1/18_api_reference.mdx | 13 - .../images/connection_opened_successfully.png | 3 - .../net_connector/8.0.2.1/images/dialog.png | 3 - .../images/dotnet_installation_complete.png | 3 - .../images/dotnet_installation_dialog.png | 3 - .../images/dotnet_installation_wizard.png | 3 - .../8.0.2.1/images/ready_to_install.png | 3 - .../selecting_the_connectors_installer.png | 3 - .../images/starting_stackbuilder_plus.png | 3 - .../docs/net_connector/8.0.2.1/index.mdx | 20 - .../release_notes/4.0.10.1_rel_notes.mdx | 13 + .../release_notes/4.0.10.2_rel_notes.mdx | 11 + .../release_notes/4.0.6.1_rel_notes.mdx | 13 + .../release_notes/4.1.3.1_rel_notes.mdx | 12 + .../release_notes/4.1.5.1_rel_notes.mdx | 12 + .../release_notes/4.1.6.1_rel_notes.mdx} | 2 +- .../release_notes/5.0.7.1_rel_notes.mdx} | 2 +- .../release_notes/6.0.2.1_rel_notes.mdx} | 2 +- .../release_notes/7.0.4.1_rel_notes.mdx} | 2 +- .../release_notes/7.0.6.1_rel_notes.mdx} | 2 +- .../release_notes/7.0.6.2_rel_notes.mdx} | 2 +- .../release_notes/8.0.2.1_rel_notes.mdx} | 2 +- .../8.0.5.1_rel_notes.mdx} | 2 +- .../8.0.5.1/release_notes/index.mdx | 215 ++++++++ 227 files changed, 284 insertions(+), 19319 deletions(-) delete mode 100644 product_docs/docs/net_connector/4.0.10.1/index.mdx delete mode 100644 product_docs/docs/net_connector/4.0.10.2/01_whats_new.mdx delete mode 100644 product_docs/docs/net_connector/4.0.10.2/02_requirements_overview.mdx delete mode 100644 product_docs/docs/net_connector/4.0.10.2/03_the_advanced_server_net_connector_overview.mdx delete mode 100644 product_docs/docs/net_connector/4.0.10.2/04_installing_and_configuring_the_net_connector.mdx delete mode 100644 product_docs/docs/net_connector/4.0.10.2/05_using_the_net_connector.mdx delete mode 100644 product_docs/docs/net_connector/4.0.10.2/06_opening_a_database_connection.mdx delete mode 100644 product_docs/docs/net_connector/4.0.10.2/07_retrieving_database_records.mdx delete mode 100644 product_docs/docs/net_connector/4.0.10.2/08_parameterized_queries.mdx delete mode 100644 product_docs/docs/net_connector/4.0.10.2/09_inserting_records_in_a_database.mdx delete mode 100644 product_docs/docs/net_connector/4.0.10.2/10_deleting_records_in_a_database.mdx delete mode 100644 product_docs/docs/net_connector/4.0.10.2/11_using_spl_stored_procedures_in_your_net_application.mdx delete mode 100644 product_docs/docs/net_connector/4.0.10.2/12_using_advanced_queueing.mdx delete mode 100644 product_docs/docs/net_connector/4.0.10.2/13_using_a_ref_cursor_in_a_net_application.mdx delete mode 100644 product_docs/docs/net_connector/4.0.10.2/14_using_plugins.mdx delete mode 100644 product_docs/docs/net_connector/4.0.10.2/15_using_object_types.mdx delete mode 100644 product_docs/docs/net_connector/4.0.10.2/16_scram_compatibility.mdx delete mode 100644 product_docs/docs/net_connector/4.0.10.2/17_advanced_server_net_connector_logging.mdx delete mode 100644 product_docs/docs/net_connector/4.0.10.2/18_api_reference.mdx delete mode 100755 product_docs/docs/net_connector/4.0.10.2/images/connection_opened_successfully.png delete mode 100755 product_docs/docs/net_connector/4.0.10.2/images/dialog.png delete mode 100755 product_docs/docs/net_connector/4.0.10.2/images/dotnet_installation_complete.png delete mode 100755 product_docs/docs/net_connector/4.0.10.2/images/dotnet_installation_dialog.png delete mode 100755 product_docs/docs/net_connector/4.0.10.2/images/dotnet_installation_wizard.png delete mode 100755 product_docs/docs/net_connector/4.0.10.2/images/ready_to_install.png delete mode 100755 product_docs/docs/net_connector/4.0.10.2/images/selecting_the_connectors_installer.png delete mode 100755 product_docs/docs/net_connector/4.0.10.2/images/starting_stackbuilder_plus.png delete mode 100644 product_docs/docs/net_connector/4.0.10.2/index.mdx delete mode 100644 product_docs/docs/net_connector/4.0.6.1/index.mdx delete mode 100644 product_docs/docs/net_connector/4.1.3.1/index.mdx delete mode 100644 product_docs/docs/net_connector/4.1.5.1/index.mdx delete mode 100644 product_docs/docs/net_connector/4.1.6.1/02_requirements_overview.mdx delete mode 100644 product_docs/docs/net_connector/4.1.6.1/03_the_advanced_server_net_connector_overview.mdx delete mode 100644 product_docs/docs/net_connector/4.1.6.1/04_installing_and_configuring_the_net_connector.mdx delete mode 100644 product_docs/docs/net_connector/4.1.6.1/05_using_the_net_connector.mdx delete mode 100644 product_docs/docs/net_connector/4.1.6.1/06_opening_a_database_connection.mdx delete mode 100644 product_docs/docs/net_connector/4.1.6.1/07_retrieving_database_records.mdx delete mode 100644 product_docs/docs/net_connector/4.1.6.1/08_parameterized_queries.mdx delete mode 100644 product_docs/docs/net_connector/4.1.6.1/09_inserting_records_in_a_database.mdx delete mode 100644 product_docs/docs/net_connector/4.1.6.1/10_deleting_records_in_a_database.mdx delete mode 100644 product_docs/docs/net_connector/4.1.6.1/11_using_spl_stored_procedures_in_your_net_application.mdx delete mode 100644 product_docs/docs/net_connector/4.1.6.1/12_using_advanced_queueing.mdx delete mode 100644 product_docs/docs/net_connector/4.1.6.1/13_using_a_ref_cursor_in_a_net_application.mdx delete mode 100644 product_docs/docs/net_connector/4.1.6.1/14_using_plugins.mdx delete mode 100644 product_docs/docs/net_connector/4.1.6.1/15_using_object_types.mdx delete mode 100644 product_docs/docs/net_connector/4.1.6.1/16_scram_compatibility.mdx delete mode 100644 product_docs/docs/net_connector/4.1.6.1/17_advanced_server_net_connector_logging.mdx delete mode 100644 product_docs/docs/net_connector/4.1.6.1/18_api_reference.mdx delete mode 100755 product_docs/docs/net_connector/4.1.6.1/images/connection_opened_successfully.png delete mode 100755 product_docs/docs/net_connector/4.1.6.1/images/dialog.png delete mode 100755 product_docs/docs/net_connector/4.1.6.1/images/dotnet_installation_complete.png delete mode 100755 product_docs/docs/net_connector/4.1.6.1/images/dotnet_installation_dialog.png delete mode 100755 product_docs/docs/net_connector/4.1.6.1/images/dotnet_installation_wizard.png delete mode 100755 product_docs/docs/net_connector/4.1.6.1/images/ready_to_install.png delete mode 100755 product_docs/docs/net_connector/4.1.6.1/images/selecting_the_connectors_installer.png delete mode 100755 product_docs/docs/net_connector/4.1.6.1/images/starting_stackbuilder_plus.png delete mode 100644 product_docs/docs/net_connector/4.1.6.1/index.mdx delete mode 100644 product_docs/docs/net_connector/5.0.7.1/02_requirements_overview.mdx delete mode 100644 product_docs/docs/net_connector/5.0.7.1/03_the_advanced_server_net_connector_overview.mdx delete mode 100644 product_docs/docs/net_connector/5.0.7.1/04_installing_and_configuring_the_net_connector.mdx delete mode 100644 product_docs/docs/net_connector/5.0.7.1/05_using_the_net_connector.mdx delete mode 100644 product_docs/docs/net_connector/5.0.7.1/06_opening_a_database_connection.mdx delete mode 100644 product_docs/docs/net_connector/5.0.7.1/07_retrieving_database_records.mdx delete mode 100644 product_docs/docs/net_connector/5.0.7.1/08_parameterized_queries.mdx delete mode 100644 product_docs/docs/net_connector/5.0.7.1/09_inserting_records_in_a_database.mdx delete mode 100644 product_docs/docs/net_connector/5.0.7.1/10_deleting_records_in_a_database.mdx delete mode 100644 product_docs/docs/net_connector/5.0.7.1/11_using_spl_stored_procedures_in_your_net_application.mdx delete mode 100644 product_docs/docs/net_connector/5.0.7.1/12_using_advanced_queueing.mdx delete mode 100644 product_docs/docs/net_connector/5.0.7.1/13_using_a_ref_cursor_in_a_net_application.mdx delete mode 100644 product_docs/docs/net_connector/5.0.7.1/14_using_plugins.mdx delete mode 100644 product_docs/docs/net_connector/5.0.7.1/15_using_object_types.mdx delete mode 100644 product_docs/docs/net_connector/5.0.7.1/16_scram_compatibility.mdx delete mode 100644 product_docs/docs/net_connector/5.0.7.1/17_advanced_server_net_connector_logging.mdx delete mode 100644 product_docs/docs/net_connector/5.0.7.1/18_api_reference.mdx delete mode 100755 product_docs/docs/net_connector/5.0.7.1/images/connection_opened_successfully.png delete mode 100755 product_docs/docs/net_connector/5.0.7.1/images/dialog.png delete mode 100755 product_docs/docs/net_connector/5.0.7.1/images/dotnet_installation_complete.png delete mode 100755 product_docs/docs/net_connector/5.0.7.1/images/dotnet_installation_dialog.png delete mode 100755 product_docs/docs/net_connector/5.0.7.1/images/dotnet_installation_wizard.png delete mode 100755 product_docs/docs/net_connector/5.0.7.1/images/ready_to_install.png delete mode 100755 product_docs/docs/net_connector/5.0.7.1/images/selecting_the_connectors_installer.png delete mode 100755 product_docs/docs/net_connector/5.0.7.1/images/starting_stackbuilder_plus.png delete mode 100644 product_docs/docs/net_connector/5.0.7.1/index.mdx delete mode 100644 product_docs/docs/net_connector/6.0.2.1/02_requirements_overview.mdx delete mode 100644 product_docs/docs/net_connector/6.0.2.1/03_the_advanced_server_net_connector_overview.mdx delete mode 100644 product_docs/docs/net_connector/6.0.2.1/04_installing_and_configuring_the_net_connector.mdx delete mode 100644 product_docs/docs/net_connector/6.0.2.1/05_using_the_net_connector.mdx delete mode 100644 product_docs/docs/net_connector/6.0.2.1/06_opening_a_database_connection.mdx delete mode 100644 product_docs/docs/net_connector/6.0.2.1/07_retrieving_database_records.mdx delete mode 100644 product_docs/docs/net_connector/6.0.2.1/08_parameterized_queries.mdx delete mode 100644 product_docs/docs/net_connector/6.0.2.1/09_inserting_records_in_a_database.mdx delete mode 100644 product_docs/docs/net_connector/6.0.2.1/10_deleting_records_in_a_database.mdx delete mode 100644 product_docs/docs/net_connector/6.0.2.1/11_using_spl_stored_procedures_in_your_net_application.mdx delete mode 100644 product_docs/docs/net_connector/6.0.2.1/12_using_advanced_queueing.mdx delete mode 100644 product_docs/docs/net_connector/6.0.2.1/13_using_a_ref_cursor_in_a_net_application.mdx delete mode 100644 product_docs/docs/net_connector/6.0.2.1/14_using_plugins.mdx delete mode 100644 product_docs/docs/net_connector/6.0.2.1/15_using_object_types.mdx delete mode 100644 product_docs/docs/net_connector/6.0.2.1/16_scram_compatibility.mdx delete mode 100644 product_docs/docs/net_connector/6.0.2.1/17_advanced_server_net_connector_logging.mdx delete mode 100644 product_docs/docs/net_connector/6.0.2.1/18_api_reference.mdx delete mode 100755 product_docs/docs/net_connector/6.0.2.1/images/connection_opened_successfully.png delete mode 100755 product_docs/docs/net_connector/6.0.2.1/images/dialog.png delete mode 100755 product_docs/docs/net_connector/6.0.2.1/images/dotnet_installation_complete.png delete mode 100755 product_docs/docs/net_connector/6.0.2.1/images/dotnet_installation_dialog.png delete mode 100755 product_docs/docs/net_connector/6.0.2.1/images/dotnet_installation_wizard.png delete mode 100755 product_docs/docs/net_connector/6.0.2.1/images/ready_to_install.png delete mode 100755 product_docs/docs/net_connector/6.0.2.1/images/selecting_the_connectors_installer.png delete mode 100755 product_docs/docs/net_connector/6.0.2.1/images/starting_stackbuilder_plus.png delete mode 100644 product_docs/docs/net_connector/6.0.2.1/index.mdx delete mode 100644 product_docs/docs/net_connector/7.0.4.1/02_requirements_overview.mdx delete mode 100644 product_docs/docs/net_connector/7.0.4.1/03_the_advanced_server_net_connector_overview.mdx delete mode 100644 product_docs/docs/net_connector/7.0.4.1/04_installing_and_configuring_the_net_connector.mdx delete mode 100644 product_docs/docs/net_connector/7.0.4.1/05_using_the_net_connector.mdx delete mode 100644 product_docs/docs/net_connector/7.0.4.1/06_opening_a_database_connection.mdx delete mode 100644 product_docs/docs/net_connector/7.0.4.1/07_retrieving_database_records.mdx delete mode 100644 product_docs/docs/net_connector/7.0.4.1/08_parameterized_queries.mdx delete mode 100644 product_docs/docs/net_connector/7.0.4.1/09_inserting_records_in_a_database.mdx delete mode 100644 product_docs/docs/net_connector/7.0.4.1/10_deleting_records_in_a_database.mdx delete mode 100644 product_docs/docs/net_connector/7.0.4.1/11_using_spl_stored_procedures_in_your_net_application.mdx delete mode 100644 product_docs/docs/net_connector/7.0.4.1/12_using_advanced_queueing.mdx delete mode 100644 product_docs/docs/net_connector/7.0.4.1/13_using_a_ref_cursor_in_a_net_application.mdx delete mode 100644 product_docs/docs/net_connector/7.0.4.1/14_using_plugins.mdx delete mode 100644 product_docs/docs/net_connector/7.0.4.1/15_using_object_types.mdx delete mode 100644 product_docs/docs/net_connector/7.0.4.1/16_scram_compatibility.mdx delete mode 100644 product_docs/docs/net_connector/7.0.4.1/17_advanced_server_net_connector_logging.mdx delete mode 100644 product_docs/docs/net_connector/7.0.4.1/18_api_reference.mdx delete mode 100755 product_docs/docs/net_connector/7.0.4.1/images/connection_opened_successfully.png delete mode 100755 product_docs/docs/net_connector/7.0.4.1/images/dialog.png delete mode 100755 product_docs/docs/net_connector/7.0.4.1/images/dotnet_installation_complete.png delete mode 100755 product_docs/docs/net_connector/7.0.4.1/images/dotnet_installation_dialog.png delete mode 100755 product_docs/docs/net_connector/7.0.4.1/images/dotnet_installation_wizard.png delete mode 100755 product_docs/docs/net_connector/7.0.4.1/images/ready_to_install.png delete mode 100755 product_docs/docs/net_connector/7.0.4.1/images/selecting_the_connectors_installer.png delete mode 100755 product_docs/docs/net_connector/7.0.4.1/images/starting_stackbuilder_plus.png delete mode 100644 product_docs/docs/net_connector/7.0.4.1/index.mdx delete mode 100644 product_docs/docs/net_connector/7.0.6.1/02_requirements_overview.mdx delete mode 100644 product_docs/docs/net_connector/7.0.6.1/03_the_advanced_server_net_connector_overview.mdx delete mode 100644 product_docs/docs/net_connector/7.0.6.1/04_installing_and_configuring_the_net_connector.mdx delete mode 100644 product_docs/docs/net_connector/7.0.6.1/05_using_the_net_connector.mdx delete mode 100644 product_docs/docs/net_connector/7.0.6.1/06_opening_a_database_connection.mdx delete mode 100644 product_docs/docs/net_connector/7.0.6.1/07_retrieving_database_records.mdx delete mode 100644 product_docs/docs/net_connector/7.0.6.1/08_parameterized_queries.mdx delete mode 100644 product_docs/docs/net_connector/7.0.6.1/09_inserting_records_in_a_database.mdx delete mode 100644 product_docs/docs/net_connector/7.0.6.1/10_deleting_records_in_a_database.mdx delete mode 100644 product_docs/docs/net_connector/7.0.6.1/11_using_spl_stored_procedures_in_your_net_application.mdx delete mode 100644 product_docs/docs/net_connector/7.0.6.1/12_using_advanced_queueing.mdx delete mode 100644 product_docs/docs/net_connector/7.0.6.1/13_using_a_ref_cursor_in_a_net_application.mdx delete mode 100644 product_docs/docs/net_connector/7.0.6.1/14_using_plugins.mdx delete mode 100644 product_docs/docs/net_connector/7.0.6.1/15_using_object_types.mdx delete mode 100644 product_docs/docs/net_connector/7.0.6.1/16_scram_compatibility.mdx delete mode 100644 product_docs/docs/net_connector/7.0.6.1/17_advanced_server_net_connector_logging.mdx delete mode 100644 product_docs/docs/net_connector/7.0.6.1/18_api_reference.mdx delete mode 100755 product_docs/docs/net_connector/7.0.6.1/images/connection_opened_successfully.png delete mode 100755 product_docs/docs/net_connector/7.0.6.1/images/dialog.png delete mode 100755 product_docs/docs/net_connector/7.0.6.1/images/dotnet_installation_complete.png delete mode 100755 product_docs/docs/net_connector/7.0.6.1/images/dotnet_installation_dialog.png delete mode 100755 product_docs/docs/net_connector/7.0.6.1/images/dotnet_installation_wizard.png delete mode 100755 product_docs/docs/net_connector/7.0.6.1/images/ready_to_install.png delete mode 100755 product_docs/docs/net_connector/7.0.6.1/images/selecting_the_connectors_installer.png delete mode 100755 product_docs/docs/net_connector/7.0.6.1/images/starting_stackbuilder_plus.png delete mode 100644 product_docs/docs/net_connector/7.0.6.1/index.mdx delete mode 100644 product_docs/docs/net_connector/7.0.6.2/02_requirements_overview.mdx delete mode 100644 product_docs/docs/net_connector/7.0.6.2/03_the_advanced_server_net_connector_overview.mdx delete mode 100644 product_docs/docs/net_connector/7.0.6.2/04_installing_and_configuring_the_net_connector.mdx delete mode 100644 product_docs/docs/net_connector/7.0.6.2/05_using_the_net_connector.mdx delete mode 100644 product_docs/docs/net_connector/7.0.6.2/06_opening_a_database_connection.mdx delete mode 100644 product_docs/docs/net_connector/7.0.6.2/07_retrieving_database_records.mdx delete mode 100644 product_docs/docs/net_connector/7.0.6.2/08_parameterized_queries.mdx delete mode 100644 product_docs/docs/net_connector/7.0.6.2/09_inserting_records_in_a_database.mdx delete mode 100644 product_docs/docs/net_connector/7.0.6.2/10_deleting_records_in_a_database.mdx delete mode 100644 product_docs/docs/net_connector/7.0.6.2/11_using_spl_stored_procedures_in_your_net_application.mdx delete mode 100644 product_docs/docs/net_connector/7.0.6.2/12_using_advanced_queueing.mdx delete mode 100644 product_docs/docs/net_connector/7.0.6.2/13_using_a_ref_cursor_in_a_net_application.mdx delete mode 100644 product_docs/docs/net_connector/7.0.6.2/14_using_plugins.mdx delete mode 100644 product_docs/docs/net_connector/7.0.6.2/15_using_object_types.mdx delete mode 100644 product_docs/docs/net_connector/7.0.6.2/16_scram_compatibility.mdx delete mode 100644 product_docs/docs/net_connector/7.0.6.2/17_advanced_server_net_connector_logging.mdx delete mode 100644 product_docs/docs/net_connector/7.0.6.2/18_api_reference.mdx delete mode 100755 product_docs/docs/net_connector/7.0.6.2/images/connection_opened_successfully.png delete mode 100755 product_docs/docs/net_connector/7.0.6.2/images/dialog.png delete mode 100755 product_docs/docs/net_connector/7.0.6.2/images/dotnet_installation_complete.png delete mode 100755 product_docs/docs/net_connector/7.0.6.2/images/dotnet_installation_dialog.png delete mode 100755 product_docs/docs/net_connector/7.0.6.2/images/dotnet_installation_wizard.png delete mode 100755 product_docs/docs/net_connector/7.0.6.2/images/ready_to_install.png delete mode 100755 product_docs/docs/net_connector/7.0.6.2/images/selecting_the_connectors_installer.png delete mode 100755 product_docs/docs/net_connector/7.0.6.2/images/starting_stackbuilder_plus.png delete mode 100644 product_docs/docs/net_connector/7.0.6.2/index.mdx delete mode 100644 product_docs/docs/net_connector/8.0.2.1/02_requirements_overview.mdx delete mode 100644 product_docs/docs/net_connector/8.0.2.1/03_the_advanced_server_net_connector_overview.mdx delete mode 100644 product_docs/docs/net_connector/8.0.2.1/04_installing_and_configuring_the_net_connector.mdx delete mode 100644 product_docs/docs/net_connector/8.0.2.1/05_using_the_net_connector.mdx delete mode 100644 product_docs/docs/net_connector/8.0.2.1/06_opening_a_database_connection.mdx delete mode 100644 product_docs/docs/net_connector/8.0.2.1/07_retrieving_database_records.mdx delete mode 100644 product_docs/docs/net_connector/8.0.2.1/08_parameterized_queries.mdx delete mode 100644 product_docs/docs/net_connector/8.0.2.1/09_inserting_records_in_a_database.mdx delete mode 100644 product_docs/docs/net_connector/8.0.2.1/10_deleting_records_in_a_database.mdx delete mode 100644 product_docs/docs/net_connector/8.0.2.1/11_using_spl_stored_procedures_in_your_net_application.mdx delete mode 100644 product_docs/docs/net_connector/8.0.2.1/12_using_advanced_queueing.mdx delete mode 100644 product_docs/docs/net_connector/8.0.2.1/13_using_a_ref_cursor_in_a_net_application.mdx delete mode 100644 product_docs/docs/net_connector/8.0.2.1/14_using_plugins.mdx delete mode 100644 product_docs/docs/net_connector/8.0.2.1/15_using_object_types.mdx delete mode 100644 product_docs/docs/net_connector/8.0.2.1/16_scram_compatibility.mdx delete mode 100644 product_docs/docs/net_connector/8.0.2.1/17_advanced_server_net_connector_logging.mdx delete mode 100644 product_docs/docs/net_connector/8.0.2.1/18_api_reference.mdx delete mode 100755 product_docs/docs/net_connector/8.0.2.1/images/connection_opened_successfully.png delete mode 100755 product_docs/docs/net_connector/8.0.2.1/images/dialog.png delete mode 100755 product_docs/docs/net_connector/8.0.2.1/images/dotnet_installation_complete.png delete mode 100755 product_docs/docs/net_connector/8.0.2.1/images/dotnet_installation_dialog.png delete mode 100755 product_docs/docs/net_connector/8.0.2.1/images/dotnet_installation_wizard.png delete mode 100755 product_docs/docs/net_connector/8.0.2.1/images/ready_to_install.png delete mode 100755 product_docs/docs/net_connector/8.0.2.1/images/selecting_the_connectors_installer.png delete mode 100755 product_docs/docs/net_connector/8.0.2.1/images/starting_stackbuilder_plus.png delete mode 100644 product_docs/docs/net_connector/8.0.2.1/index.mdx create mode 100644 product_docs/docs/net_connector/8.0.5.1/release_notes/4.0.10.1_rel_notes.mdx create mode 100644 product_docs/docs/net_connector/8.0.5.1/release_notes/4.0.10.2_rel_notes.mdx create mode 100644 product_docs/docs/net_connector/8.0.5.1/release_notes/4.0.6.1_rel_notes.mdx create mode 100644 product_docs/docs/net_connector/8.0.5.1/release_notes/4.1.3.1_rel_notes.mdx create mode 100644 product_docs/docs/net_connector/8.0.5.1/release_notes/4.1.5.1_rel_notes.mdx rename product_docs/docs/net_connector/{4.1.6.1/01_release_notes.mdx => 8.0.5.1/release_notes/4.1.6.1_rel_notes.mdx} (97%) rename product_docs/docs/net_connector/{5.0.7.1/01_release_notes.mdx => 8.0.5.1/release_notes/5.0.7.1_rel_notes.mdx} (97%) rename product_docs/docs/net_connector/{6.0.2.1/01_release_notes.mdx => 8.0.5.1/release_notes/6.0.2.1_rel_notes.mdx} (97%) rename product_docs/docs/net_connector/{7.0.4.1/01_release_notes.mdx => 8.0.5.1/release_notes/7.0.4.1_rel_notes.mdx} (97%) rename product_docs/docs/net_connector/{7.0.6.1/01_release_notes.mdx => 8.0.5.1/release_notes/7.0.6.1_rel_notes.mdx} (97%) rename product_docs/docs/net_connector/{7.0.6.2/01_release_notes.mdx => 8.0.5.1/release_notes/7.0.6.2_rel_notes.mdx} (97%) rename product_docs/docs/net_connector/{8.0.2.1/01_release_notes.mdx => 8.0.5.1/release_notes/8.0.2.1_rel_notes.mdx} (98%) rename product_docs/docs/net_connector/8.0.5.1/{01_release_notes.mdx => release_notes/8.0.5.1_rel_notes.mdx} (98%) create mode 100644 product_docs/docs/net_connector/8.0.5.1/release_notes/index.mdx diff --git a/product_docs/docs/net_connector/4.0.10.1/index.mdx b/product_docs/docs/net_connector/4.0.10.1/index.mdx deleted file mode 100644 index d2bf94255c1..00000000000 --- a/product_docs/docs/net_connector/4.0.10.1/index.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -title: EDB .NET Connector -productStub: true -directoryDefaults: - description: "EDB .NET Connector Version 4.0.10.1 Documentation and release notes." - -legacyRedirectsGenerated: - # This list is generated by a script. If you need add entries, use the `legacyRedirects` key. - - "/edb-docs/d/edb-postgres-net-connector/user-guides/net-guide/4.0.10.1/conclusion.html" - - "/edb-docs/p/edb-postgres-net-connector/4.0.10.1" - - "/edb-docs/d/edb-postgres-net-connector/user-guides/net-guide/4.0.10.1/genindex.html" - - "/edb-docs/d/edb-postgres-net-connector/user-guides/net-guide/4.0.10.1/whats_new.html" - - "/edb-docs/d/edb-postgres-net-connector/user-guides/net-guide/4.0.10.1/index.html" ---- - - diff --git a/product_docs/docs/net_connector/4.0.10.2/01_whats_new.mdx b/product_docs/docs/net_connector/4.0.10.2/01_whats_new.mdx deleted file mode 100644 index f597c6fe257..00000000000 --- a/product_docs/docs/net_connector/4.0.10.2/01_whats_new.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -title: "What’s New" - -legacyRedirectsGenerated: - # This list is generated by a script. If you need add entries, use the `legacyRedirects` key. - - "/edb-docs/d/edb-postgres-net-connector/user-guides/net-guide/4.0.10.2/whats_new.html" ---- - - - -The following features are added to create EDB .NET Connector `4.0.10.2`: - -- This version introduced a new connection parameter, Load Role Based Tables. For more information, see Connection String Parameters. diff --git a/product_docs/docs/net_connector/4.0.10.2/02_requirements_overview.mdx b/product_docs/docs/net_connector/4.0.10.2/02_requirements_overview.mdx deleted file mode 100644 index bc6530884a7..00000000000 --- a/product_docs/docs/net_connector/4.0.10.2/02_requirements_overview.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -title: "Requirements Overview" - -legacyRedirectsGenerated: - # This list is generated by a script. If you need add entries, use the `legacyRedirects` key. - - "/edb-docs/d/edb-postgres-net-connector/user-guides/net-guide/4.0.10.2/requirements_overview.html" ---- - - - -The following section details the supported platforms for the EDB .NET Connector. - -## Supported Server Versions and Platforms - -The EDB .NET Connector is certified with Advanced Server version 10 and above. - -The EDB .NET Connector graphical installers are supported on the following Windows platforms: - -64-bit Windows: - -- Windows Server 2019 -- Windows Server 2016 -- Windows Server 2012 R2 - -32-bit Windows: - -- Windows 10 -- Windows 8 -- Windows 7 - diff --git a/product_docs/docs/net_connector/4.0.10.2/03_the_advanced_server_net_connector_overview.mdx b/product_docs/docs/net_connector/4.0.10.2/03_the_advanced_server_net_connector_overview.mdx deleted file mode 100644 index 34ef1fcb441..00000000000 --- a/product_docs/docs/net_connector/4.0.10.2/03_the_advanced_server_net_connector_overview.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -title: "The EDB .NET Connector - Overview" - -legacyRedirectsGenerated: - # This list is generated by a script. If you need add entries, use the `legacyRedirects` key. - - "/edb-docs/d/edb-postgres-net-connector/user-guides/net-guide/4.0.10.2/the_advanced_server_net_connector_overview.html" ---- - - - -The EDB .NET Connector is a .NET data provider that allows a client application to connect to a database stored on an Advanced Server host. The .NET Connector accesses the data directly, allowing the client application optimal performance, a broad spectrum of functionality, and access to Advanced Server features. - -The .NET Connector supports following frameworks: - -- `.NET Framework versions 4.0 and 4.5.1` -- `.NET Standard 2.0` -- `Entity Framework 5/6` - - -## The .NET Class Hierarchy - -The .NET Class Hierarchy contains a number of classes that you can use to create objects that control a connection to the Advanced Server database and manipulate the data stored on the server. The following are just a few of the most commonly used object classes: - -`EDBConnection` - - The `EDBConnection` class represents a connection to Advanced Server. An `EDBConnection` object contains a `ConnectionString` that instructs the .NET client how to connect to an Advanced Server database. - -`EDBCommand` - - An `EDBCommand` object contains an SQL command that the client will execute against Advanced Server. Before you can execute an `EDBCommand` object, you must link it to an `EDBConnection` object. - -`EDBDataReader` - - An `EDBDataReader` object provides a way to read an Advanced Server result set. You can use an `EDBDataReader` object to step through one row at a time, forward-only. - -`EDBDataAdapter` - - An `EDBDataAdapter` object links a result set to the Advanced Server database. You can modify values and use the `EDBDataAdapter` class to update the data stored in an Advanced Server database. diff --git a/product_docs/docs/net_connector/4.0.10.2/04_installing_and_configuring_the_net_connector.mdx b/product_docs/docs/net_connector/4.0.10.2/04_installing_and_configuring_the_net_connector.mdx deleted file mode 100644 index 0fa6d8fb34d..00000000000 --- a/product_docs/docs/net_connector/4.0.10.2/04_installing_and_configuring_the_net_connector.mdx +++ /dev/null @@ -1,414 +0,0 @@ ---- -title: "Installing and Configuring the .NET Connector" - -legacyRedirectsGenerated: - # This list is generated by a script. If you need add entries, use the `legacyRedirects` key. - - "/edb-docs/d/edb-postgres-net-connector/user-guides/net-guide/4.0.10.2/installing_and_configuring_the_net_connector.html" ---- - - - -This chapter describes how to install and configure the EDB .NET Connector. - -## Installing the .NET Connector - -You can use the EDB .NET Connector Installer (available [from the EDB website](https://www.enterprisedb.com/software-downloads-postgres)) to add the .NET Connector to your system. After downloading the installer, right-click on the installer icon, and select `Run As Administrator` from the context menu. When prompted, select an installation language and click `OK` to continue to the `Setup` window. - -![The .NET Connector Installation wizard](images/dotnet_installation_wizard.png) - -The .NET Connector Installation wizard - -Click `Next` to continue. - -![The Installation dialog](images/dotnet_installation_dialog.png) - -The Installation dialog - -Use the `Installation Directory` dialog to specify the directory in which the connector will be installed, and click `Next` to continue. - -![The Ready to Install dialog](images/ready_to_install.png) - -The Ready to Install dialog - -Click `Next` on the `Ready to Install` dialog to start the installation; popup dialogs confirm the progress of the installation wizard. - -![The installation is complete](images/dotnet_installation_complete.png) - -The installation is complete - -When the wizard informs you that it has completed the setup, click the `Finish` button to exit the dialog. - -You can also use StackBuilder Plus to add or update the connector on an existing Advanced Server installation; to open StackBuilder Plus, select `StackBuilder Plus` from the Windows `Apps` menu. - -![Starting StackBuilder Plus](images/starting_stackbuilder_plus.png) - -Starting StackBuilder Plus - -When StackBuilder Plus opens, follow the onscreen instructions. - -Select the `EnterpriseDB.Net Connector` option from the `Database Drivers` node of the tree control. - -![Selecting the Connectors installer](images/selecting_the_connectors_installer.png) - -Selecting the Connectors installer - -Follow the directions of the onscreen wizard to add or update an installation of an EDB Connector. - -## Configuring the .NET Connector - -Please see the following environment-specific sections for information about configuring the .NET Connector: - -- **Referencing the Library Files.** [General configuration information](#referencing_the_library_files) applicable to all components. -- **.NET Framework 4.0** Instructions for configuring for use with [.NET Framework 4.0](#net-framework-40). -- **.NET Framework 4.5** Instructions for configuring for use with [.NET Framework 4.5](#net-framework-45). -- **.NET Framework 4.5.1** Instructions for configuring for use with [.NET Framework 4.5.1](#framework_setup_4_8). -- **.NET Standard 2.0.** Instructions for configuring for use with [.NET Standard 2.0](#standard_setup_2). -- **Entity Framework 5/6.** Instructions for configuring for use with [Entity Framework](#entity_setup_5_6). -- **EDB VSIX.** Instructions for configuring for use with [EDB VSIX](#vsix_setup). - -Please see the following environment-specific sections for information about configuring the .NET Connector: -• Referencing the Library Files. General configuration information applicable to all com- ponents. -• .NET Framework 4.0. Instructions for configuring for use with .NET Framework 4.0. -• .NET Framework 4.5. Instructions for configuring for use with .NET Framework 4.5. -• .NET Framework 4.5.1. Instructions for configuring for use with .NET Framework 4.5.1. -• .NET Standard 2.0. Instructions for configuring for use with .NET Standard 2.0. -• Entity Framework 5/6. Instructions for configuring for use with Entity Framework. -• EnterpriseDB VSIX. Instructions for configuring for use with EnterpriseDB VSIX. - -### Referencing the Library Files - - - -To reference library files with Microsoft Visual Studio: - -1. Select the project in the `Solution Explorer`. -2. Select `Add Reference` from the `Project` menu. -3. When the `Add Reference` dialog box opens, browse to select the appropriate library files. - -Optionally, the library files can be copied to the specified location. - -Before you can use an EDB .NET class, you must import the namespace into your program. Importing a namespace makes the compiler aware of the classes available within the namespace. The namespace is: - - `EnterpriseDB.EDBClient` - -If you are using Entity Framework 6, the following additional namespace is required: - - `EntityFramework6.EntepriseDB.EDBClient` - -The method you use to include the namespace varies by the type of application you are writing. For example, the following command imports a namespace into an `ASP.NET` page: - - `<% import namespace="EnterpriseDB.EDBClient" %>` - -To import a namespace into a C# application, write: - - `using EnterpriseDB.EDBClient;` - -### .NET Framework Setup - -The following sections describe the setup for various .NET versions. - - - -#### .NET Framework 4.0 - -If you are using .NET Framework version 4.0, the data provider installation path is: - - `C:\Program Files\edb\dotnet\net40\` - -The following shared library files are required: - - `EDBDataProvider.2.0.2.dll` - - `Mono.Security.dll` - -Depending upon the type of application you use, you may be required to import the namespace into the source code. See [Referencing the Library Files](#referencing_the_library_files) for this and other information about referencing library files. - - - -#### .NET Framework 4.5 - -If you are using .NET Framework version 4.5, the data provider installation path is: - - `C:\Program Files\edb\dotnet\net45\` - - You must add the following dependencies to your project: - - `EnterpriseDB.EDBClient.dll` - - `System.Threading.Tasks.Extensions.dll` - - `System.Runtime.CompilerServices.Unsafe.dll` - - `System.ValueTuple.dll` - - `System.Memory.dll` - - You must also add the following dependencies to your project: - - `System.Threading.Tasks.Extensions.dll` - - `System.Runtime.CompilerServices.Unsafe.dll` - - `System.ValueTuple.dll` - - `System.Memory.dll` - - -Depending upon the type of application you use, you may be required to import the namespace into the source code. See [Referencing the Library Files](#referencing_the_library_files) for this and other information about referencing library files. - - - -#### .NET Framework 4.5.1 - -If you are using .NET Framework version 4.5.1, the data provider installation path is: - - `C:\Program Files\edb\dotnet\net451\` - - You must add the following dependencies to your project: - - `EnterpriseDB.EDBClient.dll` - - `System.Threading.Tasks.Extensions.dll` - - `System.Runtime.CompilerServices.Unsafe.dll` - - `System.ValueTuple.dll` - - `System.Memory.dll` - - You must also add the following dependencies to your project: - - `System.Threading.Tasks.Extensions.dll` - - `System.Runtime.CompilerServices.Unsafe.dll` - - `System.ValueTuple.dll` - - `System.Memory.dll` - -Depending upon the type of application you use, you may be required to import the namespace into the source code. See [Referencing the Library Files](#referencing_the_library_files) for this and other information about referencing library files. - - - -#### .NET Standard 2.0 - -For .NET Standard Framework 2.0, the data provider installation path is: - - `C:\Program Files\edb\dotnet\netstandard2.0\` - -The following shared library files are required: - - `EnterpriseDB.EDBClient.dll` - - `System.Threading.Tasks.Extensions.dll` - - `System.Runtime.CompilerServices.Unsafe.dll` - - `System.ValueTuple.dll` - - You must also add the following dependencies to your project: - - `System.Runtime.CompilerServices.Unsafe.dll` - - `System.ValueTuple.dll` - -!!! Note - If your target framework is .Net Core 2.0, then include the following file in your project: - -`System.Threading.Tasks.Extensions.dll` - -Depending upon the type of application you use, you may be required to import the namespace into the source code. See [Referencing the Library Files](#referencing_the_library_files) for this and other information about referencing library files. - - - -### Entity Framework 5/6 - -To set up .NET Connector for usage with Entity Framework, the data provider installation path is: - - `C:\Program Files\edb\dotnet\EF\` - -The following shared library files are required: - - `EntityFramework5.EnterpriseDB.EDBClient.dll` - - `EntityFramework6.EnterpriseDB.EDBClient.dll` - - -To configure the .NET Connector for use with Entity Framework, the data provider installation path is: - -!!! Note - Entity Framework can be used with the `EnterpriseDB.EDBClient.dll` library available in the `net45` and `net451` subdirectories. - -See [Referencing the Library Files](#referencing_the_library_files) for information about referencing library files. - -Add the `` entries for the `ADO.NET` driver for Postgres to the `app.config` file. Add the following entries: - -```text - -``` - -In the project’s `app.config` file add the following entry for provider services under the EntityFramework/providers tag: - -```text - - -``` - -The following is an example of the `app.config` file: - -```text - - - -
- - - - - - - - - - - - - - - - - - - - -``` - -!!! Note - The same entries for `` and `` are valid for the `web.config` file and the `app.config` file. - -Depending upon the type of application you are using, you may be required to import the namespace into the source code (see [Referencing the Library Files](#referencing_the_library_files)). - -For usage information about Entity Framework, refer to the Microsoft documentation. - - - -### EDB VSIX for Visual Studio 2015/2017/2019 - -The EDB Data Designer Extensibility Provider (EDB VSIX) is a component that integrates Advanced Server database access into Visual Studio, thus providing Visual Studio integrated features. - -EDB VSIX allows you to connect to Advanced Server from within Visual Studio's Server Explorer and create a model from an existing database. Therefore, if Visual Studio features are desired, then EDB VSIX must be utilized. - -EDB VSIX files are located in the following directory: - - `C:\Program Files\edb\dotnet\vsix` - -The files available at the above location are: - - `EnterpriseDB.vsix` - `SSDLToPgSQL.tt` - -#### Installation and Configuration for Visual Studio 2015/2017/2019 - -Use the following steps to install and configure EDB VSIX. - -**Step 1:** Install EDB VSIX to the desired version of Visual Studio with the `EnterpriseDB.vsix` installer. - -If you already have an earlier version of the VSIX installed, we highly recommended that you uninstall it to avoid conflicts. - -It is no longer necessary or recommended to have `EnterpriseDB.EDBClient` in your global assembly cache (GAC). - -**Step 2:** Relaunch Visual Studio and verify from the `Tools > Extensions and Updates…` menu that the EDB extension is installed. - -**Step 3:** Use the gacutil utility at the Visual Studio Developers Command Line from the fol- lowing location to add the System.ValueTuple.dll library to the global assembly cache (GAC): - -`C:\Program Files\edb\dotnet\vsix\System.ValueTuple.dll` - -For example: - -`gacutil.exe /i System.ValueTuple.dll` - - -**Step 4:** From the Server Explorer, right-click on `Data Connections`, click `Add Connection`, and verify that the `Enterprisedb Postgres Database` data source is available. - -#### Model First and Database First Usage - -**Step 1:** Use the gacutil utility at the Visual Studio Developers Command Line to add the EntityFramework5.EnterpriseDB.EDBClient.dll library to the global assembly cache (GAC): - -For example: - -`gacutil.exe /i EntityFramework5.EnterpriseDB.EDBClient.dll` - -**Step 2:** Add the `` entries for the ADO.NET driver to the `machine.config` file. Include the following entries: - -```text - -``` - -For the attribute-value pairs, the double-quoted strings should not contain excess white space characters, but be configured on a single line. The examples shown in this section may be split on multiple lines for clarity, but should actually be configured within a single line such as the following: - -`description=".NET Data Provider for EnterpriseDB PostgreSQL"` - -For 64-bit Windows, the `machine.config` file is in the following location: - -`C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Config\machine.config` - -For 32-bit Windows, the `machine.config` file is in the following location: - -`C:\Windows\Microsoft.NET\Framework\v4.0.30319\Config\machine.config` - -**Step 3:** Place the DDL generation template `SSDLToPgSQL.tt` in the Visual Studio `EntityFramework Tools\DBGen\` folder as shown in the following example: - -```text -C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\Extensions\Microsoft\EntityFramework Tools\DBGen\ -``` - -!!! Note - Select this template `SSDLToPgSQL.tt` in your EDMX file properties. - -**Step 4:** Add the `EnterpriseDB.EDBClient.dll` and `EntityFramework6.EnterpriseDB.EDBClient.dll` files to project references. see [Referencing the Library Files](#referencing_the_library_files) for information about referencing library files. - -**Step 5:** In the project’s `app.config` file, add the following entry for provider services under the EntityFramework/providers tag: - -```text - - -``` - -The following is an example of the `app.config` file. - -```text - - - -
- - - - - - - - - - - - - - - - - - - - -``` diff --git a/product_docs/docs/net_connector/4.0.10.2/05_using_the_net_connector.mdx b/product_docs/docs/net_connector/4.0.10.2/05_using_the_net_connector.mdx deleted file mode 100644 index 8ac603c0834..00000000000 --- a/product_docs/docs/net_connector/4.0.10.2/05_using_the_net_connector.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -title: "Using the .NET Connector" - -legacyRedirectsGenerated: - # This list is generated by a script. If you need add entries, use the `legacyRedirects` key. - - "/edb-docs/d/edb-postgres-net-connector/user-guides/net-guide/4.0.10.2/using_the_net_connector.html" ---- - - - -The sections that follow provide examples that demonstrate using the EDB object classes that are provided by the EDB .NET Connector that allow a .NET application to connect to and interact with an Advanced Server database. - -To use the examples in this guide, place the .NET library files in the same directory as the compiled form of your application. All of the examples are written in C# and each is embedded in an ASP.NET page; the same logic and code would be applicable with other .NET applications (WinForm or console applications, for example). - -Please create and save the following `web.config` file in the same directory as the sample code. The examples make use of the `DB_CONN_STRING` key from this configuration file to return a connection string from the Advanced Server host. - -```text - - - - - - -``` - -An Advanced Server connection string for an ASP.NET web application is stored in the `web.config` file. If you are writing an application that does not use ASP.NET, provide the connection information in an application configuration file (such as `app.config`). diff --git a/product_docs/docs/net_connector/4.0.10.2/06_opening_a_database_connection.mdx b/product_docs/docs/net_connector/4.0.10.2/06_opening_a_database_connection.mdx deleted file mode 100644 index e045559cb08..00000000000 --- a/product_docs/docs/net_connector/4.0.10.2/06_opening_a_database_connection.mdx +++ /dev/null @@ -1,288 +0,0 @@ ---- -title: "Opening a Database Connection" - -legacyRedirectsGenerated: - # This list is generated by a script. If you need add entries, use the `legacyRedirects` key. - - "/edb-docs/d/edb-postgres-net-connector/user-guides/net-guide/4.0.10.2/opening_a_database_connection.html" ---- - - - -An `EDBConnection` object is responsible for handling the communication between an instance of Advanced Server and a .NET application. Before you can access data stored in an Advanced Server database, you must create and open an `EDBConnection`. - -The examples that follow demonstrate the basic steps for connecting to an instance of Advanced Server. You must: - -1. Import the namespace `EnterpriseDB.EDBClient`. -2. Create an instance of `EDBConnection`. -3. Initialize the `EDBConnection` object by passing a connection string as a parameter to the constructor for the `EDBConnection` class. -4. Call the `Open` method of the `EDBConnection` object to open the connection. - - - -## Connection String Parameters - -A valid connection string should specify location and authentication information for an Advanced Server instance. You must provide the connection string before opening the connection. A connection string must contain: - -- The name or IP address of the server -- The name of the Advanced Server database -- The name of an Advanced Server user -- The password associated with that user - -The following parameters may be included in the connection string: - -`CommandTimeout` - - `CommandTimeout` specifies the length of time (in seconds) to wait for a command to finish execution before throwing an exception. The default value is `20`. - -`ConnectionLifeTime` - - Use `ConnectionLifeTime` to specify the length of time (in seconds) to wait before closing unused connections in the pool. The default value is `15`. - -`Database` - - Use the `Database` parameter to specify the name of the database to which the application should connect. If a database name is not specified, the database name will default to the name of the connecting user. - -`Encoding` - - The `Encoding` parameter is obsolete; the parameter always returns the string unicode, and silently ignores attempts to set it. - -`Integrated Security` - - By default, `Integrated Security` is set to `false`, and Windows Integrated Security is disabled. Specify a value of `true` to use Windows Integrated Security. - -`Load Role Based Tables` - - Use `Load Role Based Tables` to load table OIDs based on role. This change only impacts the loading of table type OID, and not the composite type. The default value is `false`. Setting this parameter to `true` triggers the new functionality. - -`MaxPoolSize` - - `MaxPoolSize` instructs `EDBConnection` to dispose of pooled connections when the pool exceeds the specified number of connections. The default value is `20`. - -`MinPoolSize` - - `MinPoolSize` instructs `EDBConnection` to pre-allocate the specified number of connections with the server. The default value is `1`. - -`Password` - - When using clear text authentication, specify the password that will be used to establish a connection with the server. - -`Pooling` - - By default, `Pooling` is set to `true` to enable connection pooling. Specify a value of `false` to disable connection pooling. - -`Port` - - The `Port` parameter specifies the port to which the application should connect. - -`Protocol` - - The specific protocol version to use (instead of automatic); specify an integer value of 2 or 3. - -`SearchPath` - - Use the `SearchPath` parameter to change the search path to named and public schemas. - -`Server` - - The name or IP address of the Advanced Server host. - -`SSL` - - By default, `SSL` is set to `false`; specify a value of `true` to attempt a secure connection. - -`sslmode` - - Use `sslmode` to specify an SSL connection control preference. `sslmode` can be: - - `prefer` - Use SSL if possible. - - `require` - Throw an exception if an SSL connection cannot be established. - - `allow` - Connect without SSL. This parameter is not supported. - - `disable` - Do not attempt an SSL connection. This is the default behavior. - -`SyncNotification` - - Use the `SyncNotification` parameter to specify that `EDBDataprovider` should use synchronous notifications. The default value is `false`. - -`Timeout` - - `Timeout` specifies the length of time (in seconds) to wait for an open connection. The default value is `15`. - -`User Id` - - The `User Id` parameter specifies the user name that should be used for the connection. - -## Example - Opening a Database Connection using ASP.NET - -The following example demonstrates how to open a connection to an instance of Advanced Server and then close the connection. The connection is established using the credentials specified in the `DB_CONN_STRING` configuration parameter (see [Using the .Net Connector](05_using_the_net_connector/#using_the_net_connector) for an introduction to connection information and also see [Connection String Parameters](#connection-string-parameters) for connection parameters). - -```Text -<% @ Page Language="C#" %> -<% @Import Namespace="EnterpriseDB.EDBClient" %> -<% @Import Namespace="System.Configuration" %> - - -``` - -If the connection is successful, a browser will display the following: - -![Connection Opened Successfully](images/connection_opened_successfully.png) - -Connection Opened Successfully - -## Example - Opening a Database Connection from a Console Application - -The following example opens a connection with an Advanced Server database using a console-based application. - -Before writing the code for the console application, create an `app.config` file that stores the connection string to the database. Using a configuration file makes it convenient to update the connection string if the information changes. - -```Text - - - - - - -``` - -Using your text editor of choice, enter the following code sample into a file: - -```Text -using System; -using System.Data; -using EnterpriseDB.EDBClient; -using System.Configuration; - -namespace EnterpriseDB -{ - - class EDB - { - - static void Main(string[] args) - { - string strConnectionString = ConfigurationSettings.AppSettings - ["DB_CONN_STRING"]; - - EDBConnection conn = new EDBConnection(strConnectionString); - - try - { - conn.Open(); - Console.WriteLine("Connection Opened Successfully"); - } - - catch(Exception exp) - { - throw new Exception(exp.ToString()); - } - - finally - { - conn.Close(); - } - } - } -} -``` - -Save the file as `EDBConnection-Sample.cs` and compile it with the following command: - -`csc /r:EDBDataProvider.dll /out:Console.exe EDBConnection-Sample.cs` - -Compiling the sample should generate a `Console.exe` file; you can execute the sample code by entering `Console.exe`. When executed, the console should verify that the: - - `Connection Opened Successfully` - -## Example - Opening a Database Connection from a Windows Form Application - -The following example demonstrates opening a database connection using a .NET WinForm application. To use the example, save the following code as `WinForm-Example.cs` in a directory that contains the library files. - -```Text -using System; -using System.Windows.Forms; -using System.Drawing; -using EnterpriseDB.EDBClient; - -namespace EDBTestClient -{ - - class Win_Conn - { - static void Main(string[] args) - { - Form frmMain = new Form(); - Button btnConn = new Button(); - btnConn.Location = new System.Drawing.Point(104, 64); - btnConn.Name = "btnConn"; - btnConn.Text = "Open Connection"; - btnConn.Click += new System.EventHandler(btnConn_Click); - - frmMain.Controls.Add(btnConn); - frmMain.Text = "EnterpriseDB"; - - Application.Run(frmMain); - } - - private static void btnConn_Click(object sender, System.EventArgs e) - { - EDBConnection conn = null; - try - { - string connectionString = "Server=10.90.1.29;port=5444; - username=edb;password=edb;database=edb"; - conn = new EDBConnection(connectionString); - conn.Open(); - MessageBox.Show("Connection Open"); - } - catch(EDBException exp) - { - MessageBox.Show(exp.ToString()); - } - finally - { - conn.Close(); - } - } - } -} -``` - -Note that you must change the database connection string to point to the database that you want to connect to before compiling the file with the following command: - -`csc /r:EnterpriseDB.EDBClient.dll /out:WinForm.exe WinForm-Example.cs` - -This command should generate a `WinForm.exe` file within the same folder that the executable was compiled under. Invoking the executable will display: - -![A successful connection](images/dialog.png) - -A successful connection diff --git a/product_docs/docs/net_connector/4.0.10.2/07_retrieving_database_records.mdx b/product_docs/docs/net_connector/4.0.10.2/07_retrieving_database_records.mdx deleted file mode 100644 index 298a034646d..00000000000 --- a/product_docs/docs/net_connector/4.0.10.2/07_retrieving_database_records.mdx +++ /dev/null @@ -1,133 +0,0 @@ ---- -title: "Retrieving Database Records" - -legacyRedirectsGenerated: - # This list is generated by a script. If you need add entries, use the `legacyRedirects` key. - - "/edb-docs/d/edb-postgres-net-connector/user-guides/net-guide/4.0.10.2/retrieving_database_records.html" ---- - - - -You can use a `SELECT` statement to retrieve records from the database via a `SELECT` command. To execute a `SELECT` statement you must: - -- Create and open a database connection. -- Create an `EDBCommand` object that represents the `SELECT` statement. -- Execute the command with the `ExecuteReader()` method of the `EDBCommand` object returning a `EDBDataReader` -- Loop through the `EDBDataReader` displaying the results or binding the `EDBDataReader` to some control. - -An `EDBDataReader` object represents a forward-only and read-only stream of database records, presented one record at a time. To view a subsequent record in the stream, you must call the `Read()` method of the `EDBDataReader` object. - -The example that follows: - -1. Imports the Advanced Server namespace: `EnterpriseDB.EDBClient` -2. Initializes an `EDBCommand` object with a `SELECT` statement. -3. Opens a connection to the database. -4. Executes the `EDBCommand` by calling the `ExecuteReader` method of the `EDBCommand` object. - -The results of the SQL statement are retrieved into an `EDBDataReader` object. - -Loops through the contents of the `EDBDataReader` object to display the records returned by the query within a `WHILE` loop. - -The `Read()` method advances to the next record (if a record exists) and returns `true` if a record exists, or `false` to indicate that the `EDBDataReader` has reached the end of the result set. - -```Text -<% @ Page Language="C#" %> -<% @Import Namespace="EnterpriseDB.EDBClient" %> -<% @Import Namespace="System.Data" %> -<% @Import Namespace="System.Configuration" %> - - -``` - -To exercise the sample code, save the code in your default web root directory in a file named: - - `selectEmployees.aspx` - -To invoke the program, open a web-browser, and browse to: - - `http://localhost/selectEmployees.aspx` - -## Retrieving a Single Database Record - -To retrieve a single result from a query, use the `ExecuteScalar()` method of the `EDBCommand` object. The `ExecuteScalar()` method returns the first value of the first column of the first row of the `DataSet` generated by the specified query. - -```text -<% @ Page Language="C#" %> -<% @Import Namespace="EnterpriseDB.EDBClient" %> -<% @Import Namespace="System.Data" %> -<% @Import Namespace="System.Configuration" %> - - -``` - -Save the sample code in a file in a web root directory named: - - `selectscalar.aspx` - -To invoke the sample code, open a web-browser, and browse to: - - `http://localhost/selectScalar.aspx` - -Please note that the sample includes an explicit conversion of the value returned by the `ExecuteScalar()` method. The `ExecuteScalar()` method returns an object; to view the object, you must convert it into an integer value by using the `Convert.ToInt32` method. diff --git a/product_docs/docs/net_connector/4.0.10.2/08_parameterized_queries.mdx b/product_docs/docs/net_connector/4.0.10.2/08_parameterized_queries.mdx deleted file mode 100644 index 7017d6080dd..00000000000 --- a/product_docs/docs/net_connector/4.0.10.2/08_parameterized_queries.mdx +++ /dev/null @@ -1,66 +0,0 @@ ---- -title: "Parameterized Queries" - -legacyRedirectsGenerated: - # This list is generated by a script. If you need add entries, use the `legacyRedirects` key. - - "/edb-docs/d/edb-postgres-net-connector/user-guides/net-guide/4.0.10.2/parameterized_queries.html" ---- - - - -A `parameterized query` is a query with one or more parameter markers embedded in the SQL statement. Before executing a parameterized query, you must supply a value for each marker found in the text of the SQL statement. - -Parameterized queries are useful when you don't know the complete text of a query at the time you write your code. For example, the value referenced in a `WHERE` clause may be calculated from user input. - -As demonstrated in the following example, you must declare the data type of each parameter specified in the parameterized query by creating an `EDBParameter` object and adding that object to the command's parameter collection. Then, you must specify a `value` for each parameter by calling the parameter's `Value()` function. - -The example demonstrates use of a parameterized query with an `UPDATE` statement that increases an employee salary: - -```text -<% @ Page Language="C#" Debug="true"%> -<% @Import Namespace="EnterpriseDB.EDBClient" %> -<% @Import Namespace="System.Data" %> -<% @Import Namespace="System.Configuration" %> - - -``` - -Save the sample code in a file in a web root directory named: - - `updateSalary.aspx` - -To invoke the sample code, open a web-browser, and browse to: - - `http://localhost/updateSalary.aspx` diff --git a/product_docs/docs/net_connector/4.0.10.2/09_inserting_records_in_a_database.mdx b/product_docs/docs/net_connector/4.0.10.2/09_inserting_records_in_a_database.mdx deleted file mode 100644 index bddd6969940..00000000000 --- a/product_docs/docs/net_connector/4.0.10.2/09_inserting_records_in_a_database.mdx +++ /dev/null @@ -1,71 +0,0 @@ ---- -title: "Inserting Records in a Database" - -legacyRedirectsGenerated: - # This list is generated by a script. If you need add entries, use the `legacyRedirects` key. - - "/edb-docs/d/edb-postgres-net-connector/user-guides/net-guide/4.0.10.2/inserting_records_in_a_database.html" ---- - - - -You can use the `ExecuteNonQuery()` method of `EDBCommand` to add records to a database stored on an Advanced Server host with an `INSERT` command. - -In the example that follows, the `INSERT` command is stored in the variable cmd. The values prefixed with a colon (`:`) are placeholders for `EDBParameters` that are instantiated, assigned values, and then added to the `INSERT` command's parameter collection in the statements that follow. The `INSERT` command is executed by the `ExecuteNonQuery()` method of the `cmdInsert` object. - -The example adds a new employee to the `emp` table: - -```Text -<% @ Page Language="C#" Debug="true"%> -<% @Import Namespace="EnterpriseDB.EDBClient" %> -<% @Import Namespace="System.Data" %> -<% @Import Namespace="System.Configuration" %> - - -``` - -Save the sample code in a file in a web root directory named: - - `insertEmployee.aspx` - -To invoke the sample code, open a web-browser, and browse to: - - `http://localhost/insertEmployee.aspx` diff --git a/product_docs/docs/net_connector/4.0.10.2/10_deleting_records_in_a_database.mdx b/product_docs/docs/net_connector/4.0.10.2/10_deleting_records_in_a_database.mdx deleted file mode 100644 index c83d16a5c78..00000000000 --- a/product_docs/docs/net_connector/4.0.10.2/10_deleting_records_in_a_database.mdx +++ /dev/null @@ -1,72 +0,0 @@ ---- -title: "Deleting Records in a Database" - -legacyRedirectsGenerated: - # This list is generated by a script. If you need add entries, use the `legacyRedirects` key. - - "/edb-docs/d/edb-postgres-net-connector/user-guides/net-guide/4.0.10.2/deleting_records_in_a_database.html" ---- - - - -You can use the `ExecuteNonQuery()` method of `EDBCommand` to delete records from a database stored on an Advanced Server host with a `DELETE` statement. - -In the example that follows, the `DELETE` command is stored in the variable `strDeleteQuery`. The code passes the employee number to the Delete command (specified by: `EmpNo`). The command is then executed using the `ExecuteNonQuery()` method. The following example deletes the employee inserted in the previous example: - -```text -<% @ Page Language="C#" Debug="true"%> -<% @Import Namespace="EnterpriseDB.EDBClient" %> -<% @Import Namespace="System.Data" %> -<% @Import Namespace="System.Configuration" %> - - -``` - -Save the sample code in a file in a web root directory named: - - `deleteEmployee.aspx` - -To invoke the sample code, open a web-browser, and browse to: - - `http://localhost/deleteEmployee.aspx` diff --git a/product_docs/docs/net_connector/4.0.10.2/11_using_spl_stored_procedures_in_your_net_application.mdx b/product_docs/docs/net_connector/4.0.10.2/11_using_spl_stored_procedures_in_your_net_application.mdx deleted file mode 100644 index 244b0a04206..00000000000 --- a/product_docs/docs/net_connector/4.0.10.2/11_using_spl_stored_procedures_in_your_net_application.mdx +++ /dev/null @@ -1,420 +0,0 @@ ---- -title: "Using SPL Stored Procedures in your .NET Application" - -legacyRedirectsGenerated: - # This list is generated by a script. If you need add entries, use the `legacyRedirects` key. - - "/edb-docs/d/edb-postgres-net-connector/user-guides/net-guide/4.0.10.2/using_spl_stored_procedures_in_your_net_application.html" ---- - - - -You can include SQL statements in an application in two ways: - -- By adding the SQL statements directly in the .NET application code. -- By packaging the SQL statements in a stored procedure, and executing the stored procedure from the .NET application. - -In some cases, a stored procedure can provide advantages over embedded SQL statements. Stored procedures support complex conditional and looping constructs that are difficult to duplicate with SQL statements embedded directly in an application. - -You can also see a significant improvement in performance by using stored procedures; a stored procedure only needs to be parsed, compiled and optimized once on the server side, while a SQL statement that is included in an application may be parsed, compiled and optimized each time it is executed from a .NET application. - -To use a stored procedure in your .NET application you must: - -1. Create an SPL stored procedure on the Advanced Server host. -2. Import the `EnterpriseDB.EDBClient` namespace. -3. Pass the name of the stored procedure to the instance of the `EDBCommand`. -4. Change the `EDBCommand.CommandType` to `CommandType.StoredProcedure`. -5. `Prepare()` the command. -6. Execute the command. - -## Example - Executing a Stored Procedure without Parameters - -Our sample procedure prints the name of department 10; the procedure takes no parameters, and returns no parameters. To create the sample procedure, invoke EDB-PSQL and connect to the Advanced Server host database. Enter the following SPL code at the command line: - -```Text -CREATE OR REPLACE PROCEDURE list_dept10 -IS - v_deptname VARCHAR2(30); -BEGIN - DBMS_OUTPUT.PUT_LINE('Dept No: 10'); - SELECT dname INTO v_deptname FROM dept WHERE deptno = 10; - DBMS_OUTPUT.PUT_LINE('Dept Name: ' || v_deptname); -END; -``` - -When Advanced Server has validated the stored procedure it will echo `CREATE PROCEDURE`. - -**Using the EDBCommand Object to Execute a Stored Procedure** - -The `CommandType` property of the `EDBCommand` object is used to indicate the type of command being executed. The `CommandType` property is set to one of three possible `CommandType` enumeration values: - -- Use the default `Text` value when passing a SQL string for execution. -- Use the `StoredProcedure` value, passing the name of a stored procedure for execution. -- Use the `TableDirect` value when passing a table name. This value passes back all records in the specified table. - -The `CommandText` property must contain a SQL string, stored procedure name, or table name depending on the value of the `CommandType` property. - -The following example executes the stored procedure: - -```Text -<% @ Page Language="C#" Debug="true"%> -<% @Import Namespace="EnterpriseDB.EDBClient" %> -<% @Import Namespace="System.Data" %> -<% @Import Namespace="System.Configuration" %> - - -``` - -Save the sample code in a file in a web root directory named: - - `storedProc.aspx` - -To invoke the sample code, open a web-browser, and browse to: - - `http://localhost/storedProc.aspx` - -## Example - Executing a Stored Procedure with IN Parameters - -The following example demonstrates calling a stored procedure that includes `IN` parameters. To create the sample procedure, invoke `EDB-PSQL` and connect to the Advanced Server host database. Enter the following SPL code at the command line: - -```Text -CREATE OR REPLACE PROCEDURE - EMP_INSERT - ( - pENAME IN VARCHAR, - pJOB IN VARCHAR, - pSAL IN FLOAT4, - pCOMM IN FLOAT4, - pDEPTNO IN INTEGER, - pMgr IN INTEGER - ) -AS -DECLARE - CURSOR TESTCUR IS SELECT MAX(EMPNO) FROM EMP; - MAX_EMPNO INTEGER := 10; -BEGIN - - OPEN TESTCUR; - FETCH TESTCUR INTO MAX_EMPNO; - INSERT INTO EMP(EMPNO,ENAME,JOB,SAL,COMM,DEPTNO,MGR) - VALUES(MAX_EMPNO+1,pENAME,pJOB,pSAL,pCOMM,pDEPTNO,pMgr); - CLOSE testcur; -END; -``` - -When Advanced Server has validated the stored procedure it wEDBTypes.EDBDbType.Floatill echo `CREATE PROCEDURE`. - -**Passing Input Values to a Stored Procedure** - -Calling a stored procedure that contains parameters is very similar to executing a stored procedure without parameters. The major difference is that when calling a parameterized stored procedure you must use the `EDBParameter` collection of the `EDBCommand` object. When the `EDBParameter` is added to the `EDBCommand` collection, properties such as `ParameterName`, `DbType`, `Direction`, `Size`, and `Value` are set. - -The following example demonstrates the process of executing a parameterized stored procedure from a C#. - -```Text -<% @ Page Language="C#" Debug="true"%> -<% @Import Namespace="EnterpriseDB.EDBClient" %> -<% @Import Namespace="System.Data" %> -<% @Import Namespace="System.Configuration" %> - - - - -``` - -Save the sample code in a file in a web root directory named: - - `storedProcInParam.aspx` - -To invoke the sample code, open a web-browser, and browse to: - - `http://localhost/storedProcInParam.aspx` - -In the example, the body of the `Page_Load` method declares and instantiates an `EDBConnection` object. The sample then creates an `EDBCommand` object with the properties needed to execute the stored procedure. - -The example then uses the `Add` method of the `EDBCommand Parameter` collection to add six input parameters. - -```text -EDBCommand cmdStoredProc = new EDBCommand -("emp_insert(:EmpName,:Job,:Salary,:Commission,:DeptNo,:Manager)",conn); -cmdStoredProc.CommandType = CommandType.StoredProcedure; -``` - -It assigns a value to each parameter before passing them to the `EMP_INSERT` stored procedure - -The `Prepare()` method prepares the statement before calling the `ExecuteNonQuery()` method. - -The `ExecuteNonQuery` method of the `EDBCommand` object executes the stored procedure. After the stored procedure has executed, a test record is inserted into the `emp` table and the values inserted are displayed on the webpage. - -## Example - Executing a Stored Procedure with IN, OUT, and INOUT Parameters - -The previous example demonstrated how to pass `IN` parameters to a stored procedure; the following examples demonstrate how to pass `IN` values and return `OUT` values from a stored procedure. - -**Creating the Stored Procedure** - -The following stored procedure passes the department number, and returns the corresponding location and department name. To create the sample procedure, open the EDB-PSQL command line, and connect to the Advanced Server host database. Enter the following SPL code at the command line: - -```Text -CREATE OR REPLACE PROCEDURE - DEPT_SELECT - ( - pDEPTNO IN INTEGER, - pDNAME OUT VARCHAR, - pLOC OUT VARCHAR - ) -AS -DECLARE - CURSOR TESTCUR IS SELECT DNAME,LOC FROM DEPT; - REC RECORD; -BEGIN - - OPEN TESTCUR; - FETCH TESTCUR INTO REC; - - pDNAME := REC.DNAME; - pLOC := REC.LOC; - - CLOSE testcur; -END; -``` - -When Advanced Server has validated the stored procedure it will echo `CREATE PROCEDURE`. - -**Receiving Output Values from a Stored Procedure** - -When retrieving values from `OUT` parameters you must explicitly specify the direction of out parameters as `Output`. You can retrieve the values from `Output` parameters in two ways: - -- Call the `ExecuteReader` method of the `EDBCommand` and explicitly loop through the returned `EDBDataReader`, searching for the values of `OUT` parameters. -- Call the `ExecuteNonQuery` method of `EDBCommand` and explicitly get the value of a declared `Output` parameter by calling that `EDBParameter` value property. - -In each method, you must declare each parameter, indicating the `direction` of the parameter (`ParameterDirection.Input`, `ParameterDirection.Output` or `ParameterDirection.InputOutput`). Before invoking the procedure, you must provide a value for each `IN` and `INOUT` parameter. After the procedure returns, you may retrieve the `OUT` and `INOUT` parameter values from the `command.Parameters[]` array. - -The following code listing demonstrates using the `ExecuteReader` method to retrieve a result set: - -```Text -<% @ Page Language="C#" Debug="true"%> -<% @Import Namespace="EnterpriseDB.EDBClient" %> -<% @Import Namespace="System.Data" %> -<% @Import Namespace="System.Configuration" %> - - -``` - -The following code listing demonstrates using the `ExecuteNonQuery` method to retrieve a result set: - -```Text -<% @ Page Language="C#" Debug="true"%> -<% @Import Namespace="EnterpriseDB.EDBClient" %> -<% @Import Namespace="System.Data" %> -<% @Import Namespace="System.Configuration" %> - - -``` diff --git a/product_docs/docs/net_connector/4.0.10.2/12_using_advanced_queueing.mdx b/product_docs/docs/net_connector/4.0.10.2/12_using_advanced_queueing.mdx deleted file mode 100644 index 9f8c6586cba..00000000000 --- a/product_docs/docs/net_connector/4.0.10.2/12_using_advanced_queueing.mdx +++ /dev/null @@ -1,492 +0,0 @@ ---- -title: "Using Advanced Queueing" - -legacyRedirectsGenerated: - # This list is generated by a script. If you need add entries, use the `legacyRedirects` key. - - "/edb-docs/d/edb-postgres-net-connector/user-guides/net-guide/4.0.10.2/using_advanced_queueing.html" ---- - - - -EDB Postgres Advanced Server Advanced Queueing provides message queueing and message processing for the Advanced Server database. User-defined messages are stored in a queue; a collection of queues is stored in a queue table. You should first create a queue table before creating a queue that is dependent on it. - -On the server side, procedures in the `DBMS_AQADM` package create and manage message queues and queue tables. Use the `DBMS_AQ` package to add or remove messages from a queue, or register or unregister a PL/SQL callback procedure. For more information about `DBMS_AQ` and `DBMS_AQADM`, click [here](/epas/11/epas_compat_bip_guide/03_built-in_packages/02_dbms_aq/). - -On the client side, application uses EDB.NET driver to enqueue/dequeue message. - -## Enqueueing or Dequeueing a Message - -For more information about using Advanced Servers Advanced Queueing functionality, see the [Database Compatibility for Oracle Developers Built-in Package Guide](/epas/latest/). - -### Server-Side Setup - -To use Advanced Queueing functionality on your .NET application, you must first create a user defined type, queue table, and queue, and then start the queue on the database server. Invoke EDB-PSQL and connect to the Advanced Server host database. Use the following SPL commands at the command line: - -**Creating a User-defined Type** - -To specify a RAW data type, you should create a user-defined type. The following example demonstrates creating a user-defined type named as `myxml`. - -`CREATE TYPE myxml AS (value XML)`; - -**Creating the Queue Table** - -A queue table can hold multiple queues with the same payload type. The following example demonstrates creating a table named `MSG_QUEUE_TABLE`. - -```Text -EXEC DBMS_AQADM.CREATE_QUEUE_TABLE - (queue_table => 'MSG_QUEUE_TABLE', - queue_payload_type => 'myxml', - comment => 'Message queue table'); -END; -``` - -**Creating the Queue** - -The following example demonstrates creating a queue named `MSG_QUEUE` within the table `MSG_QUEUE_TABLE`. - -```Text -BEGIN -DBMS_AQADM.CREATE_QUEUE ( queue_name => 'MSG_QUEUE', queue_table => 'MSG_QUEUE_TABLE', comment => 'This queue contains pending messages.'); -END; -``` - -**Starting the Queue** - -Once the queue is created, invoke the following SPL code at the command line to start a queue in the EDB database. - -```Text -BEGIN -DBMS_AQADM.START_QUEUE -(queue_name => 'MSG_QUEUE'); -END; -``` - -### Client-side Example - -Once you have created a user-defined type, followed by queue table and queue, start the queue. Then, you can enqueue or dequeue a message using EDB .Net drivers. - -**Enqueue a message:** - -To enqueue a message on your .NET application, you must: - -1. Import the `EnterpriseDB.EDBClient` namespace. -2. Pass the name of the queue and create the instance of the `EDBAQQueue`. -3. Create the enqueue message and define a payload. -4. Call the `queue.Enqueue` method. - -The following code listing demonstrates using the `queue.Enqueue` method: - -!!! Note - The following code creates the message and serializes it. This is just an example code and is not going to compile if copied as it is. It is the responsibility of the user to serialize the message as XML. - -```Text -using EnterpriseDB.EDBClient; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace AQXml -{ - class MyXML - { - public string value { get; set; } - } - class Program - { - static void Main(string[] args) - { - int messagesToSend = 1; - if (args.Length > 0 && !string.IsNullOrEmpty(args[0])) - { - messagesToSend = int.Parse(args[0]); - } - for (int i = 0; i < 5; i++) - { - EnqueMsg("test message: " + i); - } - } - - private static EDBConnection GetConnection() - { - string connectionString = "Server=127.0.0.1;Host=127.0.0.1;Port=5444;User Id=enterprisedb;Password=test;Database=edb;Timeout=999"; - EDBConnection connection = new EDBConnection(connectionString); - connection.Open(); - return connection; - } - - - private static string ByteArrayToString(byte[] byteArray) - { - // Sanity check if it's null so we don't incur overhead of an exception - if (byteArray == null) - { - return string.Empty; - } - try - { - StringBuilder hex = new StringBuilder(byteArray.Length * 2); - foreach (byte b in byteArray) - { - hex.AppendFormat("{0:x2}", b); - } - - return hex.ToString().ToUpper(); - } - catch - { - return string.Empty; - } - } - - private static bool EnqueMsg(string msg) - { - EDBConnection con = GetConnection(); - using (EDBAQQueue queue = new EDBAQQueue("MSG_QUEUE", con)) - { - queue.MessageType = EDBAQMessageType.Xml; - EDBTransaction txn = queue.Connection.BeginTransaction(); - QueuedEntities.Message queuedMessage = new QueuedEntities.Message() { MessageText = msg }; - - try - { - string rootElementName = queuedMessage.GetType().Name; - if (rootElementName.IndexOf(".") != -1) - { - rootElementName = rootElementName.Split('.').Last(); - } - - string xml = new Utils.XmlFragmentSerializer().Serialize(queuedMessage); - EDBAQMessage queMsg = new EDBAQMessage(); - queMsg.Payload = new MyXML { value = xml }; - queue.MessageType = EDBAQMessageType.Udt; - queue.UdtTypeName = "myxml"; - queue.Enqueue(queMsg); - var messageId = ByteArrayToString((byte[])queMsg.MessageId); - Console.WriteLine("MessageID: " + messageId); - txn.Commit(); - queMsg = null; - xml = null; - rootElementName = null; - return true; - } - catch (Exception ex) - { - txn?.Rollback(); - Console.WriteLine("Failed to enqueue message."); - Console.WriteLine(ex.ToString()); - return false; - } - finally - { - queue?.Connection?.Dispose(); - } - } - } - - } -} -``` - -**Dequeueing a message** - -To dequeue a message on your .NET application, you must: - -1. Import the `EnterpriseDB.EDBClient` namespace. -2. Pass the name of the queue and create the instance of the `EDBAQQueue`. -3. Call the `queue.Dequeue` method. - -!!! Note - The following code creates the message and serializes it. This is just an example code and is not going to compile if copied as it is. It is the responsibility of the user to serialize the message as XML. - -```Text -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using EnterpriseDB.EDBClient; - -namespace DequeueXML -{ - class MyXML - { - public string value { get; set; } - } - class Program - { - static void Main(string[] args) - { - DequeMsg(); - } - - - private static EDBConnection GetConnection() - { - string connectionString = "Server=127.0.0.1;Host=127.0.0.1;Port=5444;User Id=enterprisedb;Password=test;Database=edb;Timeout=999"; - EDBConnection connection = new EDBConnection(connectionString); - connection.Open(); - return connection; - } - - - private static string ByteArrayToString(byte[] byteArray) - { - // Sanity check if it's null so we don't incur overhead of an exception - if (byteArray == null) - { - return string.Empty; - } - try - { - StringBuilder hex = new StringBuilder(byteArray.Length * 2); - foreach (byte b in byteArray) - { - hex.AppendFormat("{0:x2}", b); - } - - return hex.ToString().ToUpper(); - } - catch - { - return string.Empty; - } - } - public static void DequeMsg(int waitTime = 10) - { - EDBConnection con = GetConnection(); - using (EDBAQQueue queueListen = new EDBAQQueue("MSG_QUEUE", con)) - { - queueListen.UdtTypeName = "myxml"; - queueListen.DequeueOptions.Navigation = EDBAQNavigationMode.FIRST_MESSAGE; - queueListen.DequeueOptions.Visibility = EDBAQVisibility.ON_COMMIT; - queueListen.DequeueOptions.Wait = 1; - EDBTransaction txn = null; - - while (1 == 1) - { - - if (queueListen.Connection.State == System.Data.ConnectionState.Closed) - { - queueListen.Connection.Open(); - } - - string messageId = "Unknown"; - try - { - // the listen function is a blocking function. It will Wait the specified waitTime or until a - // message is received. - Console.WriteLine("Listening..."); - string v = queueListen.Listen(null, waitTime); - // If we are waiting for a message and we specify a Wait time, - // then if there are no more messages, we want to just bounce out. - if (waitTime > -1 && v == null) - { - Console.WriteLine("No message received during Wait period."); - Console.WriteLine(); - continue; - } - - // once we're here that means a message has been detected in the queue. Let's deal with it. - txn = queueListen.Connection.BeginTransaction(); - - Console.WriteLine("Attempting to dequeue message..."); - // dequeue the message - EDBAQMessage deqMsg; - try - { - deqMsg = queueListen.Dequeue(); - } - catch (Exception ex) - { - if (ex.Message.Contains("ORA-25228")) - { - Console.WriteLine("Message was not there. Another process must have picked it up."); - Console.WriteLine(); - txn.Rollback(); - continue; - } - else - { - throw; - } - } - - messageId = ByteArrayToString((byte[])deqMsg.MessageId); - if (deqMsg != null) - { - Console.WriteLine("Processing received message..."); - // process the message payload - MyXML obj = new MyXML(); - queueListen.Map(deqMsg.Payload, obj); - - QueuedEntities.Message msg = new Utils.XmlFragmentSerializer().Deserialize(obj.value); - - Console.WriteLine("Received Message:"); - Console.WriteLine("MessageID: " + messageId); - Console.WriteLine("Message: " + msg.MessageText); - Console.WriteLine("Enqueue Time" + queueListen.MessageProperties.EnqueueTime); - - txn.Commit(); - - Console.WriteLine("Finished processing message"); - Console.WriteLine(); - - } - else - { - Console.WriteLine("Message was not dequeued."); - } - } - catch (Exception ex) - { - Console.WriteLine("Failed To dequeue or process the dequeued message."); - Console.WriteLine(ex.ToString()); - Console.WriteLine(); - if (txn != null) - { - txn.Rollback(); - if (txn != null) - { - txn.Dispose(); - } - } - } - } - } - - } - } -} -``` - -## EDBAQ Classes - -The following EDBAQ classes are used in this application: - -**EDBAQDequeueMode** - -The `EDBAQDequeueMode` class lists all the dequeuer modes available. - -| **Value** | **Description** | -| ------------- | ------------------------------------------------------------- | -| Browse | Read the message without locking. | -| Locked | Reads and gets a write lock on the message. | -| Remove | Deletes the message after reading. This is the default value. | -| Remove_NoData | Confirms receipt of the message. | - -**EDBAQDequeueOptions** - -The `EDBAQDequeueOptions` class lists the options available when dequeuing a message. - -| **Property** | **Description** | -| -------------- | ------------------------------------------------------------------------------------------------------------------------------ | -| ConsumerName | The name of the consumer for which to dequeue the message. | -| DequeueMode | This is set from EDBAQDequeueMode. It represents the locking behavior linked with the dequeue option. | -| Navigation | This is set from EDBAQNavigationMode. It represents the position of the message that will be fetched. | -| Visibility | This is set from EDBAQVisibility. It represents whether the new message is dequeued or not as part of the current transaction. | -| Wait | The wait time for a message as per the search criteria. | -| Msgid | The message identifier. | -| Correlation | The correlation identifier. | -| DeqCondition | The dequeuer condition. It is a Boolean expression. | -| Transformation | The transformation that will be applied before dequeuing the message. | -| DeliveryMode | The delivery mode of the dequeued message. | - -**EDBAQEnqueueOptions** - -The `EDBAQEnqueueOptions` class lists the options available when enqueuing a message. - -| **Property** | **Description** | -| ----------------- | ------------------------------------------------------------------------------------------------------------------------------ | -| Visibility | This is set from EDBAQVisibility. It represents whether the new message is enqueued or not as part of the current transaction. | -| RelativeMsgid | The relative message identifier. | -| SequenceDeviation | The sequence when the message should be dequeued. | -| Transformation | The transformation that will be applied before enqueuing the message. | -| DeliveryMode | The delivery mode of the enqueued message. | - -**EDBAQMessage** - -The `EDBAQMessage` class lists a message to be enqueued/dequeued. - -| **Property** | **Description** | -| ------------ | -------------------------------- | -| Payload | The actual message to be queued. | -| MessageId | The ID of the queued message. | - -**EDBAQMessageProperties** - -The `EDBAQMessageProperties` lists the message properties available. - -| **Property** | **Description** | -| ---------------- | --------------------------------------------------------------------------------------------- | -| Priority | The priority of the message. | -| Delay | The duration post which the message is available for dequeuing. This is specified in seconds. | -| Expiration | The duration for which the message is available for dequeuing. This is specified in seconds. | -| Correlation | The correlation identifier. | -| Attempts | The number of attempts taken to dequeue the message. | -| RecipientList | The receipients list that overthrows the default queue subscribers. | -| ExceptionQueue | The name of the queue where the unprocessed messages should be moved. | -| EnqueueTime | The time when the message was enqueued. | -| State | The state of the message while dequeue. | -| OriginalMsgid | The message identifier in the last queue. | -| TransactionGroup | The transaction group for the dequeued messages. | -| DeliveryMode | The delivery mode of the dequeued message. | - -**EDBAQMessageState** - -The `EDBAQMessageState` class represents the state of the message during dequeue. - -| **Value** | **Description** | -| --------- | ---------------------------------------------------------- | -| Expired | The message is moved to the exception queue. | -| Processed | The message is processed and kept. | -| Ready | The message is ready to be processed. | -| Waiting | The message is in waiting state. The delay is not reached. | - -**EDBAQMessageType** - -The `EDBAQMessageType` class represents the types for payload. - -| **Value** | **Description** | -| --------- | ------------------------------------------------------------------------------------- | -| Raw | The raw message type.

Note: Currently, this payload type is not supported. | -| UDT | The user defined type message. | -| XML | The XML type message.

Note: Currently, this payload type is not supported. | - -**EDBAQNavigationMode** - -The `EDBAQNavigationMode` class represents the different types of navigation modes available. - -| **Value** | **Description** | -| ---------------- | ------------------------------------------------------------------ | -| First_Message | Returns the first available message that matches the search terms. | -| Next_Message | Returns the next available message that matches the search items. | -| Next_Transaction | Returns the first message of next transaction group. | - -**EDBAQQueue** - -The `EDBAQQueue` class represents a SQL statement to execute `DMBS_AQ` functionality on a PostgreSQL database. - -| **Property** | **Description** | -| ----------------- | --------------------------------------------------------------------------------------------- | -| Connection | The connection to be used. | -| Name | The name of the queue. | -| MessageType | The message type that is enqueued/dequeued from this queue. For example EDBAQMessageType.Udt. | -| UdtTypeName | The user defined type name of the message type. | -| EnqueueOptions | The enqueue options to be used. | -| DequeuOptions | The dequeue options to be used. | -| MessageProperties | The message properties to be used. | - -**EDBAQVisibility** - -The `EDBAQVisibility` class represents the visibility options available. - -| **Value** | **Description** | -| --------- | ----------------------------------------------------------- | -| Immediate | The enqueue/dequeue is not part of the ongoing transaction. | -| On_Commit | The enqueue/dequeue is part of the current transaction. | - -!!! Note - - To review the default options for the above parameters, click [here](/epas/11/epas_compat_bip_guide/03_built-in_packages/02_dbms_aq/). - - EDB Advanced Queueing functionality uses user-defined types for calling enqueue/dequeue operations. `Server Compatibility Mode=NoTypeLoading` cannot be used with Advanced Queueing because `NoTypeLoading` will not load any user-defined types. diff --git a/product_docs/docs/net_connector/4.0.10.2/13_using_a_ref_cursor_in_a_net_application.mdx b/product_docs/docs/net_connector/4.0.10.2/13_using_a_ref_cursor_in_a_net_application.mdx deleted file mode 100644 index d32386b2b2b..00000000000 --- a/product_docs/docs/net_connector/4.0.10.2/13_using_a_ref_cursor_in_a_net_application.mdx +++ /dev/null @@ -1,110 +0,0 @@ ---- -title: "Using a Ref Cursor in a .NET Application" - -legacyRedirectsGenerated: - # This list is generated by a script. If you need add entries, use the `legacyRedirects` key. - - "/edb-docs/d/edb-postgres-net-connector/user-guides/net-guide/4.0.10.2/using_a_ref_cursor_in_a_net_application.html" ---- - - - -A `ref cursor` is a cursor variable that contains a pointer to a query result set. The result set is determined by the execution of the `OPEN FOR` statement using the cursor variable. A cursor variable is not tied to a particular query like a static cursor. The same cursor variable may be opened a number of times with the `OPEN FOR` statement containing different queries and each time, a new result set will be created for that query and made available via the cursor variable. There are two ways to declare a cursor variable: - -- Use the `SYS_REFCURSOR` built-in data type to declare a weakly-typed ref cursor. -- Define a strongly-typed ref cursor that declares a variable of that type. - -`SYS_REFCURSOR` is a ref cursor type that allows any result set to be associated with it. This is known as a weakly-typed ref cursor. The following example is a declaration of a weakly-typed ref cursor: - - `name SYS_REFCURSOR`; - -Following is an example of a strongly-typed ref cursor: - - `TYPE IS REF CURSOR RETURN emp%ROWTYPE`; - -**Creating the Stored Procedure** - -The following sample code creates a stored procedure called `refcur_inout_callee`. To create the sample procedure, invoke EDB-PSQL and connect to the Advanced Server host database. Enter the following SPL code at the command line: - -```Text -CREATE OR REPLACE PROCEDURE - refcur_inout_callee(v_refcur IN OUT SYS_REFCURSOR) -IS -BEGIN - OPEN v_refcur FOR SELECT ename FROM emp; -END; -``` - -To use the above defined procedure from .NET code, you must specify the data type of the ref cursor being passed as an `IN` parameter, as shown in the above script. - -The following C# code uses the stored procedure to retrieve employee names from the `emp` table: - -```Text -using System; -using System.Data; -using EnterpriseDB.EDBClient; -using System.Configuration; - -namespace EDBRefCursor -{ - class EmpRefcursor - { - [STAThread] - static void Main(string[] args) - { - string strConnectionString = - ConfigurationSettings.AppSettings["DB_CONN_STRING"]; - EDBConnection conn = new EDBConnection(strConnectionString); - conn.Open(); - try - { - EDBTransaction tran = conn.BeginTransaction(); - EDBCommand command = new EDBCommand("refcur_inout_callee", - conn); - command.CommandType = CommandType.StoredProcedure; - command.Transaction = tran; - command.Parameters.Add(new EDBParameter("refCursor", - EDBTypes.EDBDbType.Refcursor, 10, "refCursor", - - ParameterDirection.InputOutput, false, 2, 2, - System.Data.DataRowVersion.Current, null)); - - command.Prepare(); - command.Parameters[0].Value = null; - - command.ExecuteNonQuery(); - String cursorName = command.Parameters[0].Value.ToString(); - command.CommandText = "fetch all in \"" + cursorName + "\""; - command.CommandType = CommandType.Text; - - EDBDataReader reader = - command.ExecuteReader(CommandBehavior.SequentialAccess); - int fc = reader.FieldCount; - while (reader.Read()) - { - for (int i = 0; i < fc; i++) - { - Console.WriteLine(reader.GetString(i)); - } - } - reader.Close(); - tran.Commit(); - } - catch (Exception ex) - { - Console.WriteLine(ex.Message.ToString()); - } - } - } -} -``` - -The following .NET code snippet displays the result on the console: - -```Text -for(int i = 0;i < fc; i++) -{ - Console.WriteLine(reader.GetString(i)); -} -``` - -Please note that you must bind the `EDBDbType.RefCursor` type in `EDBParameter()` if you are using a ref cursor parameter. diff --git a/product_docs/docs/net_connector/4.0.10.2/14_using_plugins.mdx b/product_docs/docs/net_connector/4.0.10.2/14_using_plugins.mdx deleted file mode 100644 index 5c42f1ed5ef..00000000000 --- a/product_docs/docs/net_connector/4.0.10.2/14_using_plugins.mdx +++ /dev/null @@ -1,210 +0,0 @@ ---- -title: "Using Plugins" - -legacyRedirectsGenerated: - # This list is generated by a script. If you need add entries, use the `legacyRedirects` key. - - "/edb-docs/d/edb-postgres-net-connector/user-guides/net-guide/4.0.10.2/using_plugins.html" ---- - - - -EDB .Net driver plugins are introduced to support the enhanced capabilities for different data types, which are otherwise not available in .Net. The different plugins available support: - -- GeoJSON -- Json.NET -- Legacy PostGIS -- NetTopologySuite -- NodaTime -- Rawpostgis - -The plugins support the use of spatial, data/time and Json types. The following sections detail the supported frameworks and data provider installation path for these plugins. - -## GeoJSON - -If you are using the GeoJSON plugin on .NET Framework 4.5, the data provider installation path is: - - `C:\Program Files\edb\dotnet\plugins\GeoJSON\net45` - -The following shared library files are required: - - `EnterpriseDB.EDBClient.GeoJSON.dll` - - `GeoJSON.Net.dll` - - `Newtonsoft.Json.dll` - -If you are using the GeoJSON plugin on .NET Framework 4.6.1, the data provider installation path is: - - `C:\Program Files\edb\dotnet\plugins\GeoJSON\net461` - -The following shared library files are required: - - `EnterpriseDB.EDBClient.GeoJSON.dll` - `GeoJSON.Net.dll` - `Newtonsoft.Json.dll` - - -If you are using the GeoJSON plugin on .NET Standard 2.0, the data provider installation path is: - - `C:\Program Files\edb\dotnet\plugins\GeoJSON\netstandard2.0` - -The following shared library files are required: - -`EnterpriseDB.EDBClient.GeoJSON.dll` - -For detailed information about using the GeoJSON plugin, see the [Npgsql documentation](http://www.npgsql.org/doc/types/geojson.html). - -## Json.NET - -If you are using the Json.NET plugin on .NET Framework 4.5, the data provider installation path is: - - `C:\Program Files\edb\dotnet\plugins\Json.NET\net45` - -The following shared library files are required: - - `EnterpriseDB.EDBClient.Json.NET.dll` - - `Newtonsoft.Json.dll` - -If you are using the Json.NET plugin on .NET Framework 4.6.1, the data provider installation path is: - - `C:\Program Files\edb\dotnet\plugins\Json.NET\net461` - -The following shared library files are required: - - `EnterpriseDB.EDBClient.Json.NET.dll` - `Newtonsoft.Json.dll` - -If you are using the Json.NET plugin on .NET Standard 2.0, the data provider installation path is: - - `C:\Program Files\edb\dotnet\plugins\Json.NET\netstandard2.0` - -The following shared library files are required: - -`EnterpriseDB.EDBClient.Json.NET.dll` - -For detailed information about using the Json.NET plugin, see the [Npgsql documentation](http://www.npgsql.org/doc/types/jsonnet.html). - -## LegacyPostGIS - -If you are using the LegacyPostGIS plugin on .Net Framework 4.5, the data provider installation path is: - - `C:\Program Files\edb\dotnet\plugins\LegacyPostgis\net45` - -The following shared library files are required: - - `EnterpriseDB.EDBClient.LegacyPostgis.dll` - -If you are using the LegacyPostGIS plugin on .Net Framework 4.6.1, the data provider installation path is: - - `C:\Program Files\edb\dotnet\plugins\LegacyPostgis\net461` - -The following shared library files are required: - - `EnterpriseDB.EDBClient.LegacyPostgis.dll` - -If you are using the LegacyPostGIS plugin on .Net Standard 2.0, the data provider installation path is: - - `C:\Program Files\edb\dotnet\plugins\LegacyPostgis\netstandard2.0` - -The following shared library files are required: - - `EnterpriseDB.EDBClient.LegacyPostgis.dll` - -For detailed information about using the LegacyPostGIS plugin, see the [Npgsql documentation](http://www.npgsql.org/doc/types/legacy-postgis.html). - -## NetTopologySuite - -If you are using the NetTopologySuite plugin on .Net Framework 4.5, the data provider installation path is: - - `C:\Program Files\edb\dotnet\\ plugins\NetTopologySuite\net45` - -The following shared library files are required: - - `EnterpriseDB.EDBClient.NetTopologySuite.dll` - - `GeoAPI.dll` - - `NetTopologySuite.dll` - - `NetTopologySuite.IO.PostGis.dll` - -If you are using the NetTopologySuite plugin on .Net Framework 4.6.1, the data provider installation path is: - - `C:\Program Files\edb\dotnet\plugins\NetTopologySuite\net461` - -The following shared library files are required: - - `EnterpriseDB.EDBClient.NetTopologySuite.dll` - `NetTopologySuite.dll` - `NetTopologySuite.IO.PostGis.dll` - -If you are using the NetTopologySuite plugin on .Net Standard 2.0, the data provider installation path is: - - `C:\Program Files\edb\dotnet\plugins\NetTopologySuite\netstandard2.0` - -The following shared library files are required: - - `EnterpriseDB.EDBClient.NetTopologySuite.dll` - -For detailed information about using the NetTopologySuite type plugin, see the [Npgsql documentation](http://www.npgsql.org/doc/types/nts.html). - -## NodaTime - -If you are using the NodaTime plugin on .Net Framework 4.5, the data provider installation path is: - - `C:\Program Files\edb\dotnet\plugins\NodaTime\net45` - -The following shared library files are required: - - `EnterpriseDB.EDBClient.NodaTime.dll` - - `NodaTime.dll` - -If you are using the NodaTime plugin on .Net Framework 4.6.1, the data provider installation path is: - - `C:\Program Files\edb\dotnet\plugins\NodaTime\net461` - -The following shared library files are required: - - `EnterpriseDB.EDBClient.NodaTime.dll` - `NodaTime.dll` - -If you are using the NodaTime plugin on .Net Standard 2.0, the data provider installation path is: - - `C:\Program Files\edb\dotnet\plugins\NodaTime\netstandard2.0` - -The following shared library files are required: - - `EnterpriseDB.EDBClient.NodaTime.dll` - -For detailed information about using the NodaTime plugin, see the [Npgsql documentation](http://www.npgsql.org/doc/types/nodatime.html). - -## RawPostGIS - -If you are using the RawPostGIS plugin on .Net Framework 4.5, the data provider installation path is: - - `C:\Program Files\edb\dotnet\plugins\RawPostgis\net45` - -The following shared library files are required: - - `EnterpriseDB.EDBClient.RawPostgis.dll` - -If you are using the RawPostGIS plugin on .Net Framework 4.6.1, the data provider installation path is: - - `C:\Program Files\edb\dotnet\plugins\RawPostgis\net461` - -The following shared library files are required: - - `EnterpriseDB.EDBClient.RawPostgis.dll` - - -If you are using the RawPostGIS type plugin on .Net Standard 2.0, the data provider installation path is: - - `C:\Program\Files\edb\dotnet\plugins\RawPostGis\netstandard2.0` - -The following shared library files are required: - - `EnterpriseDB.EDBClient.RawPostgis.dll` - -For detailed information about using the RawPostGIS plugin, see the [documentation](https://www.nuget.org/packages/Npgsql.RawPostgis). diff --git a/product_docs/docs/net_connector/4.0.10.2/15_using_object_types.mdx b/product_docs/docs/net_connector/4.0.10.2/15_using_object_types.mdx deleted file mode 100644 index f9c5feb00ac..00000000000 --- a/product_docs/docs/net_connector/4.0.10.2/15_using_object_types.mdx +++ /dev/null @@ -1,187 +0,0 @@ ---- -title: "Using Object Types in .NET" - ---- - - - -The SQL `CREATE TYPE` command is used to create a user-defined `object type`, which is stored in the Advanced Server database. - -These user-defined types can then be referenced within SPL procedures, SPL functions, and .NET programs. - -The basic object type is created with the `CREATE TYPE AS OBJECT` command along with optional usage of the `CREATE TYPE BODY` command. - -An example that demonstrates using an object type is shown in the following section. - -## Using an Object Type - -To use an object type, you must first create the object type in the Advanced Server database. Object type `addr_object_type` defines the attributes of an address: - -```text -CREATE OR REPLACE TYPE addr_object_type AS OBJECT -( - street VARCHAR2(30), - city VARCHAR2(20), - state CHAR(2), - zip NUMBER(5) -); -``` - -Object type `emp_obj_typ` defines the attributes of an employee. Note that one of these attributes is object type `ADDR_OBJECT_TYPE` as previously described. The object type body contains a method that displays the employee information: - -```text -CREATE OR REPLACE TYPE emp_obj_typ AS OBJECT -( - empno NUMBER(4), - ename VARCHAR2(20), - addr ADDR_OBJECT_TYPE, - MEMBER PROCEDURE display_emp(SELF IN OUT emp_obj_typ) -); - -CREATE OR REPLACE TYPE BODY emp_obj_typ AS - MEMBER PROCEDURE display_emp (SELF IN OUT emp_obj_typ) - IS - BEGIN - DBMS_OUTPUT.PUT_LINE('Employee No : ' || SELF.empno); - DBMS_OUTPUT.PUT_LINE('Name : ' || SELF.ename); - DBMS_OUTPUT.PUT_LINE('Street : ' || SELF.addr.street); - DBMS_OUTPUT.PUT_LINE('City/State/Zip: ' || SELF.addr.city || ', ' || - SELF.addr.state || ' ' || LPAD(SELF.addr.zip,5,'0')); - END; -END; -``` - -The following listing is a complete .NET program that uses these user-defined object types: - -```text -namespace ObjectTypesSample -{ - class Program - { - static void Main(string[] args) - { - EDBConnection.GlobalTypeMapper.MapComposite("enterprisedb.addr_object_type"); - EDBConnection.GlobalTypeMapper.MapComposite("enterprisedb.emp_obj_typ"); - EDBConnection conn = new EDBConnection("Server=localhost;Port=5444;database=test;User ID=enterprisedb;password=;"); - - try - { - conn.Open(); - - EDBCommand cmd = new EDBCommand("emp_obj_typ.display_emp", conn); - - cmd.CommandType = System.Data.CommandType.StoredProcedure; - EDBCommandBuilder.DeriveParameters(cmd); - - addr_object_type address = new addr_object_type() - { - street = "123 MAIN STREET", - city = "EDISON", - state = "NJ", - zip = 8817 - }; - - emp_obj_typ emp = new emp_obj_typ() - { - empno = 9001, - ename = "JONES", - addr = address - }; - cmd.Parameters[0].Value = emp; - cmd.Prepare(); - cmd.ExecuteNonQuery(); - - emp_obj_typ empOut = (emp_obj_typ)cmd.Parameters[0].Value; - Console.WriteLine("Emp No: " + empOut.empno); - Console.WriteLine("Emp Name: " + empOut.ename); - Console.WriteLine("Emp Address Street: " + empOut.addr.street); - Console.WriteLine("Emp Address City: " + empOut.addr.city); - Console.WriteLine("Emp Address State: " + empOut.addr.state); - Console.WriteLine("Emp Address Zip: " + empOut.addr.zip); - Console.WriteLine("Emp No: " + empOut.empno); - } - catch (EDBException exp) - { - Console.WriteLine(exp.Message.ToString()); - } - finally - { - conn.Close(); - } - } - } - - public class addr_object_type - { - public string street; - public string city; - public string state; - public decimal zip; - } - - public class emp_obj_typ - { - public decimal empno; - public string ename; - public addr_object_type addr; - } -} -``` - -The following .NET types are defined to map to the types in Advanced Server: - -```text -public class addr_object_type -{ - public string street; - public string city; - public string state; - public decimal zip; -} - -public class emp_obj_typ -{ - public decimal empno; - public string ename; - public addr_object_type addr; -} -``` - -A call to `EDBConnection.GlobalTypeMapper.MapComposite` maps the .NET type to the Advanced Server types: - -```text -EDBConnection.GlobalTypeMapper.MapComposite("enterprisedb.addr_object_type"); - EDBConnection.GlobalTypeMapper.MapComposite("enterprisedb.emp_obj_typ"); -``` - -A call to `EDBCommandBuilder.DeriveParameters()` gets parameter information for a stored procedure. This allows you to just set the parameter values and call the stored procedure: - -```text -EDBCommandBuilder.DeriveParameters(cmd); -``` - -The value of the parameter is set by creating an object of the .NET type and assigning it to the `Value` property of the parameter: - -```text -addr_object_type address = new addr_object_type() -{ - street = "123 MAIN STREET", - city = "EDISON", - state = "NJ", - zip = 8817 -}; - -emp_obj_typ emp = new emp_obj_typ() -{ - empno = 9001, - ename = "JONES", - addr = address -}; -cmd.Parameters[0].Value = emp; -``` - -A call to `cmd.ExecuteNonQuery()` executes the call to the `display_emp()` method: - -```text -cmd.ExecuteNonQuery(); -``` diff --git a/product_docs/docs/net_connector/4.0.10.2/16_scram_compatibility.mdx b/product_docs/docs/net_connector/4.0.10.2/16_scram_compatibility.mdx deleted file mode 100644 index 9b5a5b8414d..00000000000 --- a/product_docs/docs/net_connector/4.0.10.2/16_scram_compatibility.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -title: "Scram Compatibility" -legacyRedirects: - - "/edb-docs/d/edb-postgres-net-connector/user-guides/net-guide/4.1.6.1/security_and_encryption.html" - -legacyRedirectsGenerated: - # This list is generated by a script. If you need add entries, use the `legacyRedirects` key. - - "/edb-docs/d/edb-postgres-net-connector/user-guides/net-guide/4.0.10.2/scram_compatibility.html" ---- - - - -The EDB .NET driver provides SCRAM-SHA-256 support for Advanced Server versions 12, 11 and 10. This support is available from EDB .NET 4.0.2.1 release onwards. \ No newline at end of file diff --git a/product_docs/docs/net_connector/4.0.10.2/17_advanced_server_net_connector_logging.mdx b/product_docs/docs/net_connector/4.0.10.2/17_advanced_server_net_connector_logging.mdx deleted file mode 100644 index cfe7cedec8a..00000000000 --- a/product_docs/docs/net_connector/4.0.10.2/17_advanced_server_net_connector_logging.mdx +++ /dev/null @@ -1,104 +0,0 @@ ---- -title: "EDB .NET Connector Logging" - ---- - - - -EDB .NET Connector supports the use of logging to help resolve issues with the .NET Connector when used in your application. The connector uses classes in the `EnterpriseDB.EDBClient.Logging` namespace for logging. - -**Console Logging to Standard Error** - -`EnterpriseDB.EDBClient.Logging.ConsoleLoggingProvider` is a class that outputs error messages to `STDERR`. To use this class, include the following line in your application before using any of the Advanced Server .NET Connector APIs. - -`EnterpriseDB.EDBClient.Logging.EDBLogManager.Provider = new EnterpriseDB.EDBClient.Logging.ConsoleLoggingProvider(EDBLogLevel.Debug, true, true);` - -The following log levels are available: - -- Trace -- Debug -- Info -- Warn -- Error -- Fatal - -**Writing a Custom Logger** - -If the console logging provider does not fulfill your requirements, you can write a custom logger by implementing the `EnterpriseDB.EDBClient.Logging.IEDBLoggingProvider` interface, and extending the `EnterpriseDB.EDBClient.Logging.EDBLogger` class, for instance, writing your logs to a file. The following is a simple example of how to write a custom logger: - -```text -public class MyLoggingProvider : IEDBLoggingProvider - { - string _logFile; - readonly EDBLogLevel _minLevel; - readonly bool _printLevel; - readonly bool _printConnectorId; - - public MyLoggingProvider(string logFile, EDBLogLevel minLevel = EDBLogLevel.Info, bool printLevel = false, bool printConnectorId = false) - { - _logFile = logFile; - _minLevel = minLevel; - _printLevel = printLevel; - _printConnectorId = printConnectorId; - } - - public EDBLogger CreateLogger(string name) - { - return new MyLogger(_logFile, _minLevel, _printLevel, _printConnectorId); - } - } - - class MyLogger : EDBLogger - { - string _logFile; - readonly EDBLogLevel _minLevel; - readonly bool _printLevel; - readonly bool _printConnectorId; - - internal MyLogger(string logFile, EDBLogLevel minLevel, bool printLevel, bool printConnectorId) - { - _logFile = logFile; - _minLevel = minLevel; - _printLevel = printLevel; - _printConnectorId = printConnectorId; - } - - public override bool IsEnabled(EDBLogLevel level) => level >= _minLevel; - - public override void Log(EDBLogLevel level, int connectorId, string msg, Exception exception = null) - { - if (!IsEnabled(level)) - return; - - - using (StreamWriter writer = new StreamWriter(_logFile, true)) - { - var sb = new StringBuilder(); - if (_printLevel) - { - sb.Append(level.ToString().ToUpper()); - sb.Append(' '); - } - - if (_printConnectorId && connectorId != 0) - { - sb.Append("["); - sb.Append(connectorId); - sb.Append("] "); - } - - sb.AppendLine(msg); - - if (exception != null) - sb.AppendLine(exception.ToString()); - - writer.Write(sb.ToString()); - } - - } - } -``` - -To use this custom logger, put the following line in your application before using any of the EDB .NET Connector APIs: - -`EDBLogManager.Provider = new MyLoggingProvider(filepath, EDBLogLevel.Debug, true, true);` diff --git a/product_docs/docs/net_connector/4.0.10.2/18_api_reference.mdx b/product_docs/docs/net_connector/4.0.10.2/18_api_reference.mdx deleted file mode 100644 index d99a2085acf..00000000000 --- a/product_docs/docs/net_connector/4.0.10.2/18_api_reference.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -title: "API Reference" - -legacyRedirectsGenerated: - # This list is generated by a script. If you need add entries, use the `legacyRedirects` key. - - "/edb-docs/d/edb-postgres-net-connector/user-guides/net-guide/4.0.10.2/api_reference.html" ---- - - - -For information about using the API, see the [Npgsql documentation](http://www.npgsql.org/doc/api/Npgsql.html). - -Usage notes: - -- When using the API, replace references to `Npgsql` with `EnterpriseDB.EDBClient`. -- When referring to classes, replace `Npgsql` with `EDB`. For example, use the `EDBBinaryExporter` class instead of the `NpgsqlBinaryExporter` class. diff --git a/product_docs/docs/net_connector/4.0.10.2/images/connection_opened_successfully.png b/product_docs/docs/net_connector/4.0.10.2/images/connection_opened_successfully.png deleted file mode 100755 index bab12126d20..00000000000 --- a/product_docs/docs/net_connector/4.0.10.2/images/connection_opened_successfully.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:537e7edecce3882b794110e0ffc644a51cab69ba2c7e7f82a3e99d32c4b4ba65 -size 22683 diff --git a/product_docs/docs/net_connector/4.0.10.2/images/dialog.png b/product_docs/docs/net_connector/4.0.10.2/images/dialog.png deleted file mode 100755 index 19cba54d1f9..00000000000 --- a/product_docs/docs/net_connector/4.0.10.2/images/dialog.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:f922e6cd4e43927708b5f460f5389a5b3a41dd70f3a5394723e6aee7d710f1ae -size 9048 diff --git a/product_docs/docs/net_connector/4.0.10.2/images/dotnet_installation_complete.png b/product_docs/docs/net_connector/4.0.10.2/images/dotnet_installation_complete.png deleted file mode 100755 index 3a8d3a0eb02..00000000000 --- a/product_docs/docs/net_connector/4.0.10.2/images/dotnet_installation_complete.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:623cecb40b7c1ce26641ee9072c916553e2b79efba8ffe276b90bf5203cf7e3c -size 86308 diff --git a/product_docs/docs/net_connector/4.0.10.2/images/dotnet_installation_dialog.png b/product_docs/docs/net_connector/4.0.10.2/images/dotnet_installation_dialog.png deleted file mode 100755 index b465d536032..00000000000 --- a/product_docs/docs/net_connector/4.0.10.2/images/dotnet_installation_dialog.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:994a725f061f1b51fd92ccc2df5abd9066a1cf4ea7600611ae57ebc6cc59af20 -size 51144 diff --git a/product_docs/docs/net_connector/4.0.10.2/images/dotnet_installation_wizard.png b/product_docs/docs/net_connector/4.0.10.2/images/dotnet_installation_wizard.png deleted file mode 100755 index 99b731c9688..00000000000 --- a/product_docs/docs/net_connector/4.0.10.2/images/dotnet_installation_wizard.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:d74f5e2ba8dc157d45d7d6560c152e8b0039092d3de4363403cd0c4a5ffb4112 -size 80007 diff --git a/product_docs/docs/net_connector/4.0.10.2/images/ready_to_install.png b/product_docs/docs/net_connector/4.0.10.2/images/ready_to_install.png deleted file mode 100755 index 59e44d96bc5..00000000000 --- a/product_docs/docs/net_connector/4.0.10.2/images/ready_to_install.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:91b18bef7b78a6dae7d6b664e2bccfbfdb4248dbd034cb59e2c6a35ada7da49c -size 44080 diff --git a/product_docs/docs/net_connector/4.0.10.2/images/selecting_the_connectors_installer.png b/product_docs/docs/net_connector/4.0.10.2/images/selecting_the_connectors_installer.png deleted file mode 100755 index e322dd834ec..00000000000 --- a/product_docs/docs/net_connector/4.0.10.2/images/selecting_the_connectors_installer.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:70c0ffedddbd8c5972853ce2fc6fee88e2a398594e01b90d00012f0c0956846a -size 98220 diff --git a/product_docs/docs/net_connector/4.0.10.2/images/starting_stackbuilder_plus.png b/product_docs/docs/net_connector/4.0.10.2/images/starting_stackbuilder_plus.png deleted file mode 100755 index 392aaa87fdc..00000000000 --- a/product_docs/docs/net_connector/4.0.10.2/images/starting_stackbuilder_plus.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:0756f2b14caa14049f52660d1a25f60b35f666e70241c17d78c2e63743c3b074 -size 103715 diff --git a/product_docs/docs/net_connector/4.0.10.2/index.mdx b/product_docs/docs/net_connector/4.0.10.2/index.mdx deleted file mode 100644 index 89cce9ef8ae..00000000000 --- a/product_docs/docs/net_connector/4.0.10.2/index.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -title: EDB .NET Connector -productStub: true -directoryDefaults: - description: "EDB .NET Connector Version 4.0.10.2 Documentation and release notes." - -legacyRedirectsGenerated: - # This list is generated by a script. If you need add entries, use the `legacyRedirects` key. - - "/edb-docs/d/edb-postgres-net-connector/user-guides/net-guide/4.0.10.2/conclusion.html" - - "/edb-docs/p/edb-postgres-net-connector/4.0.10.2" - - "/edb-docs/d/edb-postgres-net-connector/user-guides/net-guide/4.0.10.2/whats_new.html" - - "/edb-docs/d/edb-postgres-net-connector/user-guides/net-guide/4.0.10.2/genindex.html" - - "/edb-docs/d/edb-postgres-net-connector/user-guides/net-guide/4.0.10.2/index.html" -pdf: true ---- - -The EDB .NET Connector distributed with EDB Postgres Advanced Server (Advanced Server) provides connectivity between a .NET client application and an Advanced Server database server. This guide provides installation instructions, usage instructions, and examples that demonstrate the functionality of the EDB .NET Connector: - -- How to connect to an instance of Advanced Server. -- How to retrieve information from an Advanced Server database. -- How to update information stored on an Advanced Server database. - -This document assumes that you have a solid working knowledge of both C# and .NET. The EDB .NET Connector functionality is built on the core functionality of the Npgsql open source project. The *Npgsql User's Manual* is available [online](http://www.npgsql.org/doc/index.html). - -
- -whats_new requirements_overview the_advanced_server_net_connector_overview installing_and_configuring_the_net_connector using_the_net_connector opening_a_database_connection retrieving_database_records parameterized_queries inserting_records_in_a_database deleting_records_in_a_database using_spl_stored_procedures_in_your_net_application using_advanced_queueing using_a_ref_cursor_in_a_net_application using_plugins using_object_types scram_compatibility advanced_server_net_connector_logging api_reference conclusion - -
diff --git a/product_docs/docs/net_connector/4.0.6.1/index.mdx b/product_docs/docs/net_connector/4.0.6.1/index.mdx deleted file mode 100644 index 3637ba4af5a..00000000000 --- a/product_docs/docs/net_connector/4.0.6.1/index.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -title: EDB .NET Connector -productStub: true -directoryDefaults: - description: "EDB .NET Connector Version 4.0.6.1 Documentation and release notes." - -legacyRedirectsGenerated: - # This list is generated by a script. If you need add entries, use the `legacyRedirects` key. - - "/edb-docs/d/edb-postgres-net-connector/user-guides/net-guide/4.0.6.1/conclusion.html" - - "/edb-docs/d/edb-postgres-net-connector/user-guides/net-guide/4.0.6.1/whats_new.html" - - "/edb-docs/p/edb-postgres-net-connector/4.0.6.1" - - "/edb-docs/d/edb-postgres-net-connector/user-guides/net-guide/4.0.6.1/genindex.html" - - "/edb-docs/d/edb-postgres-net-connector/user-guides/net-guide/4.0.6.1/index.html" ---- - - diff --git a/product_docs/docs/net_connector/4.1.3.1/index.mdx b/product_docs/docs/net_connector/4.1.3.1/index.mdx deleted file mode 100644 index d1983bf1818..00000000000 --- a/product_docs/docs/net_connector/4.1.3.1/index.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -title: EDB .NET Connector -productStub: true -directoryDefaults: - description: "EDB .NET Connector Version 4.1.3.1 Documentation and release notes." - -legacyRedirectsGenerated: - # This list is generated by a script. If you need add entries, use the `legacyRedirects` key. - - "/edb-docs/d/edb-postgres-net-connector/user-guides/net-guide/4.1.3.1/whats_new.html" - - "/edb-docs/p/edb-postgres-net-connector/4.1.3.1" - - "/edb-docs/d/edb-postgres-net-connector/user-guides/net-guide/4.1.3.1/genindex.html" - - "/edb-docs/d/edb-postgres-net-connector/user-guides/net-guide/4.1.3.1/conclusion.html" - - "/edb-docs/d/edb-postgres-net-connector/user-guides/net-guide/4.1.3.1/index.html" ---- - - diff --git a/product_docs/docs/net_connector/4.1.5.1/index.mdx b/product_docs/docs/net_connector/4.1.5.1/index.mdx deleted file mode 100644 index dad52c0d343..00000000000 --- a/product_docs/docs/net_connector/4.1.5.1/index.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -title: EDB .NET Connector -productStub: true -directoryDefaults: - description: "EDB .NET Connector Version 4.1.5.1 Documentation and release notes." - -legacyRedirectsGenerated: - # This list is generated by a script. If you need add entries, use the `legacyRedirects` key. - - "/edb-docs/p/edb-postgres-net-connector/4.1.5.1" - - "/edb-docs/d/edb-postgres-net-connector/user-guides/net-guide/4.1.5.1/whats_new.html" - - "/edb-docs/d/edb-postgres-net-connector/user-guides/net-guide/4.1.5.1/genindex.html" - - "/edb-docs/d/edb-postgres-net-connector/user-guides/net-guide/4.1.5.1/conclusion.html" - - "/edb-docs/d/edb-postgres-net-connector/user-guides/net-guide/4.1.5.1/index.html" ---- - - diff --git a/product_docs/docs/net_connector/4.1.6.1/02_requirements_overview.mdx b/product_docs/docs/net_connector/4.1.6.1/02_requirements_overview.mdx deleted file mode 100644 index 1decefa3f86..00000000000 --- a/product_docs/docs/net_connector/4.1.6.1/02_requirements_overview.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -title: "Requirements Overview" - -legacyRedirectsGenerated: - # This list is generated by a script. If you need add entries, use the `legacyRedirects` key. - - "/edb-docs/d/edb-postgres-net-connector/user-guides/net-guide/4.1.6.1/requirements_overview.html" ---- - - - -The following section details the supported platforms for the EDB .NET Connector. - -## Supported Server Versions and Platforms - -The EDB .NET Connector is certified with Advanced Server version 10 and above. - -The EDB .NET Connector graphical installers are supported on the following Windows platforms: - -64-bit Windows: - -- Windows Server 2019 -- Windows Server 2016 -- Windows Server 2012 R2 -- Windows 10 -- Windows 8.1 - -32-bit Windows: - -- Windows 10 -- Windows 8.1 diff --git a/product_docs/docs/net_connector/4.1.6.1/03_the_advanced_server_net_connector_overview.mdx b/product_docs/docs/net_connector/4.1.6.1/03_the_advanced_server_net_connector_overview.mdx deleted file mode 100644 index d3e262afdcf..00000000000 --- a/product_docs/docs/net_connector/4.1.6.1/03_the_advanced_server_net_connector_overview.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -title: "The EDB .NET Connector - Overview" - -legacyRedirectsGenerated: - # This list is generated by a script. If you need add entries, use the `legacyRedirects` key. - - "/edb-docs/d/edb-postgres-net-connector/user-guides/net-guide/4.1.6.1/the_advanced_server_net_connector_overview.html" ---- - - - -The EDB .NET Connector is a .NET data provider that allows a client application to connect to a database stored on an Advanced Server host. The .NET Connector accesses the data directly, allowing the client application optimal performance, a broad spectrum of functionality, and access to Advanced Server features. - -The .NET Connector supports following frameworks: - -- `.NET Framework versions 4.6.1, 4.7.2 and 4.8` -- `.NET Standard 2.0 and 2.1` -- `.NET Core 3.0` -- `Entity Framework 6` -- `EDB VSIX` - -## The .NET Class Hierarchy - -The .NET Class Hierarchy contains a number of classes that you can use to create objects that control a connection to the Advanced Server database and manipulate the data stored on the server. The following are just a few of the most commonly used object classes: - -`EDBConnection` - - The `EDBConnection` class represents a connection to Advanced Server. An `EDBConnection` object contains a `ConnectionString` that instructs the .NET client how to connect to an Advanced Server database. - -`EDBCommand` - - An `EDBCommand` object contains an SQL command that the client will execute against Advanced Server. Before you can execute an `EDBCommand` object, you must link it to an `EDBConnection` object. - -`EDBDataReader` - - An `EDBDataReader` object provides a way to read an Advanced Server result set. You can use an `EDBDataReader` object to step through one row at a time, forward-only. - -`EDBDataAdapter` - - An `EDBDataAdapter` object links a result set to the Advanced Server database. You can modify values and use the `EDBDataAdapter` class to update the data stored in an Advanced Server database. diff --git a/product_docs/docs/net_connector/4.1.6.1/04_installing_and_configuring_the_net_connector.mdx b/product_docs/docs/net_connector/4.1.6.1/04_installing_and_configuring_the_net_connector.mdx deleted file mode 100644 index ef59f322540..00000000000 --- a/product_docs/docs/net_connector/4.1.6.1/04_installing_and_configuring_the_net_connector.mdx +++ /dev/null @@ -1,494 +0,0 @@ ---- -title: "Installing and Configuring the .NET Connector" - -legacyRedirectsGenerated: - # This list is generated by a script. If you need add entries, use the `legacyRedirects` key. - - "/edb-docs/d/edb-postgres-net-connector/user-guides/net-guide/4.1.6.1/installing_and_configuring_the_net_connector.html" ---- - - - -This chapter describes how to install and configure the EDB .NET Connector. - -## Installing the .NET Connector - -You can use the EDB .NET Connector Installer (available [from the EDB website](https://www.enterprisedb.com/software-downloads-postgres)) to add the .NET Connector to your system. After downloading the installer, right-click on the installer icon, and select `Run As Administrator` from the context menu. When prompted, select an installation language and click `OK` to continue to the `Setup` window. - -![The .NET Connector Installation wizard](images/dotnet_installation_wizard.png) - -The .NET Connector Installation wizard - -Click `Next` to continue. - -![The Installation dialog](images/dotnet_installation_dialog.png) - -The Installation dialog - -Use the `Installation Directory` dialog to specify the directory in which the connector will be installed, and click `Next` to continue. - -![The Ready to Install dialog](images/ready_to_install.png) - -The Ready to Install dialog - -Click `Next` on the `Ready to Install` dialog to start the installation; popup dialogs confirm the progress of the installation wizard. - -![The installation is complete](images/dotnet_installation_complete.png) - -The installation is complete - -When the wizard informs you that it has completed the setup, click the `Finish` button to exit the dialog. - -You can also use StackBuilder Plus to add or update the connector on an existing Advanced Server installation; to open StackBuilder Plus, select `StackBuilder Plus` from the Windows `Apps` menu. - -![Starting StackBuilder Plus](images/starting_stackbuilder_plus.png) - -Starting StackBuilder Plus - -When StackBuilder Plus opens, follow the onscreen instructions. - -Select the `EnterpriseDB.Net Connector` option from the `Database Drivers` node of the tree control. - -![Selecting the Connectors installer](images/selecting_the_connectors_installer.png) - -Selecting the Connectors installer - -Follow the directions of the onscreen wizard to add or update an installation of an EDB Connector. - -## Configuring the .NET Connector - -Please see the following environment-specific sections for information about configuring the .NET Connector: - -- **Referencing the Library Files.** [General configuration information](#referencing_the_library_files) applicable to all components. -- **.NET Framework 4.6.1** Instructions for configuring for use with [.NET Framework 4.6.1](#net-framework-461). -- **.NET Framework 4.7.2** Instructions for configuring for use with [.NET Framework 4.7.2](#framework_setup_4_7_2). -- **.NET Framework 4.8** Instructions for configuring for use with [.NET Framework 4.8](#framework_setup_4_8). -- **.NET Standard 2.0.** Instructions for configuring for use with [.NET Standard 2.0](#standard_setup_2). -- **.NET Standard 2.1.** Instructions for configuring for use with [.NET Standard 2.1](#standard_setup_2_1). -- **.NET Core 3.0** Instructions for configuring for use with [.NET Core 3.0](#framework_setup_core3_0). -- **Entity Framework 6.** Instructions for configuring for use with [Entity Framework](#entity_setup_5_6). -- **EDB VSIX.** Instructions for configuring for use with [EDB VSIX](#vsix_setup). - -### Referencing the Library Files - - - -To reference library files with Microsoft Visual Studio: - -1. Select the project in the `Solution Explorer`. -2. Select `Add Reference` from the `Project` menu. -3. When the `Add Reference` dialog box opens, browse to select the appropriate library files. - -Optionally, the library files can be copied to the specified location. - -Before you can use an EDB .NET class, you must import the namespace into your program. Importing a namespace makes the compiler aware of the classes available within the namespace. The namespace is: - - `EnterpriseDB.EDBClient` - -If you are using Entity Framework 6, the following additional namespace is required: - - `EntityFramework6.EntepriseDB.EDBClient` - -The method you use to include the namespace varies by the type of application you are writing. For example, the following command imports a namespace into an `ASP.NET` page: - - `<% import namespace="EnterpriseDB.EDBClient" %>` - -To import a namespace into a C# application, write: - - `using EnterpriseDB.EDBClient;` - -### .NET Framework Setup - -The following sections describe the setup for various .NET versions. - - - -#### .NET Framework 4.6.1 - -If you are using .NET Framework version 4.6.1, the data provider installation path is: - - `C:\Program Files\edb\dotnet\net461\` - -You must add the following dependencies to your project: - - `EnterpriseDB.EDBClient.dll` - - `Microsoft.Bcl.AsyncInterfaces.dll` - - `System.Memory.dll` - - `System.Numerics.Vectors.dll` - - `System.Runtime.CompilerServices.Unsafe.dll` - - `System.Runtime.dll` - - `System.Text.Json.dll` - - `System.Threading.Tasks.Extensions.dll` - - `System.ValueTuple.dll` - -Depending upon the type of application you use, you may be required to import the namespace into the source code. See [Referencing the Library Files](#referencing_the_library_files) for this and other information about referencing library files. - - - -#### .NET Framework 4.7.2 - -If you are using .NET Framework version 4.7.2, the data provider installation path is: - - `C:\Program Files\edb\dotnet\net472\` - - You must add the following dependencies to your project: - - `EnterpriseDB.EDBClient.dll` - - `Microsoft.Bcl.AsyncInterfaces.dll` - - `System.Memory.dll` - - `System.Numerics.Vectors.dll` - - `System.Runtime.CompilerServices.Unsafe.dll` - - `System.Text.Json.dll` - - `System.Threading.Tasks.Extensions.dll` - -Depending upon the type of application you use, you may be required to import the namespace into the source code. See [Referencing the Library Files](#referencing_the_library_files) for this and other information about referencing library files. - - - -#### .NET Framework 4.8 - -If you are using .NET Framework version 4.8, the data provider installation path is: - - `C:\Program Files\edb\dotnet\net48\` - - You must add the following dependencies to your project: - - `EnterpriseDB.EDBClient.dll` - - `Microsoft.Bcl.AsyncInterfaces.dll` - - `System.Memory.dll` - - `System.Numerics.Vectors.dll` - - `System.Runtime.CompilerServices.Unsafe.dll` - - `System.Text.Json.dll` - - `System.Threading.Tasks.Extensions.dll` - -Depending upon the type of application you use, you may be required to import the namespace into the source code. See [Referencing the Library Files](#referencing_the_library_files) for this and other information about referencing library files. - - - -#### .NET Standard 2.0 - -For .NET Standard Framework 2.0, the data provider installation path is: - - `C:\Program Files\edb\dotnet\netstandard2.0\` - -You must add the following dependencies to your project: - - `EnterpriseDB.EDBClient.dll` - - `System.Threading.Tasks.Extensions.dll` - - `System.Runtime.CompilerServices.Unsafe.dll` - - `System.ValueTuple.dll` - -!!! Note - If your target framework is .Net Core 2.0, then include the following file in your project: - -`System.Threading.Tasks.Extensions.dll` - -Depending upon the type of application you use, you may be required to import the namespace into the source code. See [Referencing the Library Files](#referencing_the_library_files) for this and other information about referencing library files. - - - -#### .NET Standard 2.1 - -For .NET Standard Framework 2.1, the data provider installation path is: - - `C:\Program Files\edb\dotnet\netstandard2.1\` - -The following shared library files are required: - - `EnterpriseDB.EDBClient.dll` - - `System.Memory.dll` - - `System.Runtime.CompilerServices.Unsafe.dll` - - `System.Text.Json.dll` - - `System.Threading.Tasks.Extensions.dll` - - `System.ValueTuple.dll` - -Depending upon the type of application you use, you may be required to import the namespace into the source code. See [Referencing the Library Files](#referencing_the_library_files) for this and other information about referencing library files. - - - -#### .NET Core 3.0 - -If you are using .NET Core 3.0, the data provider installation path is: - - `C:\Program Files\edb\dotnet\netcoreapp3.0\` - -The following shared library files are required: - - `EnterpriseDB.EDBClient.dll` - - `System.Threading.Tasks.Extensions.dll` - - `System.Runtime.CompilerServices.Unsafe.dll` - - `System.ValueTuple.dll` - - `System.Memory.dll` - -Depending upon the type of application you use, you may be required to import the namespace into the source code. See [Referencing the Library Files](#referencing_the_library_files) for this and other information about referencing library files. - - - -### Entity Framework 6 - -To configure the .NET Connector for use with Entity Framework, the data provider installation path is: - -**For net461** - - `C:\Program Files\edb\dotnet\EF\net461` - -The following shared library file is required: - - `EntityFramework6.EnterpriseDB.EDBClient.dll` - -**For net472** - - `C:\Program Files\edb\dotnet\EF\net472` - -The following shared library file is required: - - `EntityFramework6.EnterpriseDB.EDBClient.dll` - -**For net48** - - `C:\Program Files\edb\dotnet\EF\net48` - -The following shared library file is required: - - `EntityFramework6.EnterpriseDB.EDBClient.dll` - -!!! Note - Entity Framework can be used with the `EnterpriseDB.EDBClient.dll` library available in the `net461`, `net472` and `net48` subdirectories. - -See [Referencing the Library Files](#referencing_the_library_files) for information about referencing library files. - -Add the `` entries for the `ADO.NET` driver for Postgres to the `app.config` file. Add the following entries: - -```text - -``` - -In the project’s `app.config` file add the following entry for provider services under the EntityFramework/providers tag: - -```text - - -``` - -The following is an example of the `app.config` file: - -```text - - - -
- - - - - - - - - - - - - - - - - - - - -``` - -!!! Note - The same entries for `` and `` are valid for the `web.config` file and the `app.config` file. - -Depending upon the type of application you are using, you may be required to import the namespace into the source code (see [Referencing the Library Files](#referencing_the_library_files)). - -For usage information about Entity Framework, refer to the Microsoft documentation. - - - -### EDB VSIX for Visual Studio 2015/2017/2019 - -The EDB Data Designer Extensibility Provider (EDB VSIX) is a component that integrates Advanced Server database access into Visual Studio, thus providing Visual Studio integrated features. - -EDB VSIX allows you to connect to Advanced Server from within Visual Studio's Server Explorer and create a model from an existing database. Therefore, if Visual Studio features are desired, then EDB VSIX must be utilized. - -EDB VSIX files are located in the following directory: - - `C:\Program Files\edb\dotnet\vsix` - -The files available at the above location are: - - `edb_logo.ico` - `EnterpriseDB.vsix` - `SSDLToPgSQL.tt` - `System.ValueTuple.dll` - -#### Installation and Configuration for Visual Studio 2015/2017/2019 - -Use the following steps to install and configure EDB VSIX. - -**Step 1:** Install EDB VSIX to the desired version of Visual Studio with the `EnterpriseDB.vsix` installer. - -If you already have an earlier version of the VSIX installed, we highly recommended that you uninstall it to avoid conflicts. - -It is no longer necessary or recommended to have `EnterpriseDB.EDBClient` in your global assembly cache (GAC). - -**Step 2:** Relaunch Visual Studio and verify from the `Tools > Extensions and Updates…` menu that the EDB extension is installed. - -**Step 3:** Use the `gacutil` utility at the Visual Studio Developers Command Line to add following libraries to the global assembly cache (GAC): - -`System.ValueTuple.dll` -`System.Threading.Tasks.Extensions.dll` -`System.Runtime.CompilerServices.Unsafe.dll` -`System.Memory.dll` -`Microsoft.Bcl.AsyncInterfaces.dll` -`System.Text.Json.dll` - -For example: - - `> gacutil.exe /i System.ValueTuple.dll` - -**Step 4:** From the Server Explorer, right-click on `Data Connections`, click `Add Connection`, and verify that the `Enterprisedb Postgres Database` data source is available. - -#### Model First and Database First Usage - -**Step 1:** Add the `` entries for the ADO.NET driver to the `machine.config` file. Include the following entries: - -```text - -``` - -For the attribute-value pairs, the double-quoted strings should not contain excess white space characters, but be configured on a single line. The examples shown in this section may be split on multiple lines for clarity, but should actually be configured within a single line such as the following: - -`description=".NET Data Provider for EnterpriseDB PostgreSQL"` - -For 64-bit Windows, the `machine.config` file is in the following location: - -`C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Config\machine.config` - -For 32-bit Windows, the `machine.config` file is in the following location: - -`C:\Windows\Microsoft.NET\Framework\v4.0.30319\Config\machine.config` - -**Step 2:** Place the DDL generation template `SSDLToPgSQL.tt` in the Visual Studio `EntityFramework Tools\DBGen\` folder as shown in the following example: - -```text -C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\Extensions\Microsoft\EntityFramework Tools\DBGen\ -``` - -!!! Note - Select this template `SSDLToPgSQL.tt` in your EDMX file properties. - -**Step 3:** Add the `EnterpriseDB.EDBClient.dll` and `EntityFramework6.EnterpriseDB.EDBClient.dll` files to project references. see [Referencing the Library Files](#referencing_the_library_files) for information about referencing library files. - -**Step 4:** Configure your Entity Framework application in either of following two ways: - -- Code-based -- Config-based. - -**Code-based** - -Define a class that inherits from `DbConfiguration` in the same assembly as your class inheriting `DbContext`. Ensure that you configure `provider services`, a `provider factory`, and a `default connection factory` as shown below: - -```text -using EnterpriseDB.EDBClient; -using System.Data.Entity; - -class EDBConfiguration : DbConfiguration -{ - public EDBConfiguration() - { - - var name = "EnterpriseDB.EDBClient"; - - SetProviderFactory(providerInvariantName: name, - providerFactory: EnterpriseDB.EDBClient.EDBFactory.Instance); - - SetProviderServices(providerInvariantName: name, - provider: EnterpriseDB.EDBClient.EDBServices.Instance); - - SetDefaultConnectionFactory(connectionFactory: new EnterpriseDB.EDBClient.EDBConnectionFactory()); - } -} -``` - -**Config-based** - -In the project’s `app.config` file, add the following entry for provider services under the EntityFramework/providers tag: - -```text - - -``` - -The following is an example of the `app.config` file. - -```text - - - -
- - - - - - - - - - - - - - - - - - - - -``` diff --git a/product_docs/docs/net_connector/4.1.6.1/05_using_the_net_connector.mdx b/product_docs/docs/net_connector/4.1.6.1/05_using_the_net_connector.mdx deleted file mode 100644 index d5ffd64eb51..00000000000 --- a/product_docs/docs/net_connector/4.1.6.1/05_using_the_net_connector.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -title: "Using the .NET Connector" - -legacyRedirectsGenerated: - # This list is generated by a script. If you need add entries, use the `legacyRedirects` key. - - "/edb-docs/d/edb-postgres-net-connector/user-guides/net-guide/4.1.6.1/using_the_net_connector.html" ---- - - - -The sections that follow provide examples that demonstrate using the EDB object classes that are provided by the EDB .NET Connector that allow a .NET application to connect to and interact with an Advanced Server database. - -To use the examples in this guide, place the .NET library files in the same directory as the compiled form of your application. All of the examples are written in C# and each is embedded in an ASP.NET page; the same logic and code would be applicable with other .NET applications (WinForm or console applications, for example). - -Please create and save the following `web.config` file in the same directory as the sample code. The examples make use of the `DB_CONN_STRING` key from this configuration file to return a connection string from the Advanced Server host. - -```text - - - - - - -``` - -An Advanced Server connection string for an ASP.NET web application is stored in the `web.config` file. If you are writing an application that does not use ASP.NET, provide the connection information in an application configuration file (such as `app.config`). diff --git a/product_docs/docs/net_connector/4.1.6.1/06_opening_a_database_connection.mdx b/product_docs/docs/net_connector/4.1.6.1/06_opening_a_database_connection.mdx deleted file mode 100644 index 2e5d071911c..00000000000 --- a/product_docs/docs/net_connector/4.1.6.1/06_opening_a_database_connection.mdx +++ /dev/null @@ -1,288 +0,0 @@ ---- -title: "Opening a Database Connection" - -legacyRedirectsGenerated: - # This list is generated by a script. If you need add entries, use the `legacyRedirects` key. - - "/edb-docs/d/edb-postgres-net-connector/user-guides/net-guide/4.1.6.1/opening_a_database_connection.html" ---- - - - -An `EDBConnection` object is responsible for handling the communication between an instance of Advanced Server and a .NET application. Before you can access data stored in an Advanced Server database, you must create and open an `EDBConnection`. - -The examples that follow demonstrate the basic steps for connecting to an instance of Advanced Server. You must: - -1. Import the namespace `EnterpriseDB.EDBClient`. -2. Create an instance of `EDBConnection`. -3. Initialize the `EDBConnection` object by passing a connection string as a parameter to the constructor for the `EDBConnection` class. -4. Call the `Open` method of the `EDBConnection` object to open the connection. - - - -## Connection String Parameters - -A valid connection string should specify location and authentication information for an Advanced Server instance. You must provide the connection string before opening the connection. A connection string must contain: - -- The name or IP address of the server -- The name of the Advanced Server database -- The name of an Advanced Server user -- The password associated with that user - -The following parameters may be included in the connection string: - -`CommandTimeout` - - `CommandTimeout` specifies the length of time (in seconds) to wait for a command to finish execution before throwing an exception. The default value is `20`. - -`ConnectionLifeTime` - - Use `ConnectionLifeTime` to specify the length of time (in seconds) to wait before closing unused connections in the pool. The default value is `15`. - -`Database` - - Use the `Database` parameter to specify the name of the database to which the application should connect. If a database name is not specified, the database name will default to the name of the connecting user. - -`Encoding` - - The `Encoding` parameter is obsolete; the parameter always returns the string unicode, and silently ignores attempts to set it. - -`Integrated Security` - - By default, `Integrated Security` is set to `false`, and Windows Integrated Security is disabled. Specify a value of `true` to use Windows Integrated Security. - -`Load Role Based Tables` - - Use `Load Role Based Tables` to load table OIDs based on role. This change only impacts the loading of table type OID, and not the composite type. The default value is `false`. Setting this parameter to `true` triggers the new functionality. - -`MaxPoolSize` - - `MaxPoolSize` instructs `EDBConnection` to dispose of pooled connections when the pool exceeds the specified number of connections. The default value is `20`. - -`MinPoolSize` - - `MinPoolSize` instructs `EDBConnection` to pre-allocate the specified number of connections with the server. The default value is `1`. - -`Password` - - When using clear text authentication, specify the password that will be used to establish a connection with the server. - -`Pooling` - - By default, `Pooling` is set to `true` to enable connection pooling. Specify a value of `false` to disable connection pooling. - -`Port` - - The `Port` parameter specifies the port to which the application should connect. - -`Protocol` - - The specific protocol version to use (instead of automatic); specify an integer value of 2 or 3. - -`SearchPath` - - Use the `SearchPath` parameter to change the search path to named and public schemas. - -`Server` - - The name or IP address of the Advanced Server host. - -`SSL` - - By default, `SSL` is set to `false`; specify a value of `true` to attempt a secure connection. - -`sslmode` - - Use `sslmode` to specify an SSL connection control preference. `sslmode` can be: - - `prefer` - Use SSL if possible. - - `require` - Throw an exception if an SSL connection cannot be established. - - `allow` - Connect without SSL. This parameter is not supported. - - `disable` - Do not attempt an SSL connection. This is the default behavior. - -`SyncNotification` - - Use the `SyncNotification` parameter to specify that `EDBDataprovider` should use synchronous notifications. The default value is `false`. - -`Timeout` - - `Timeout` specifies the length of time (in seconds) to wait for an open connection. The default value is `15`. - -`User Id` - - The `User Id` parameter specifies the user name that should be used for the connection. - -## Example - Opening a Database Connection using ASP.NET - -The following example demonstrates how to open a connection to an instance of Advanced Server and then close the connection. The connection is established using the credentials specified in the `DB_CONN_STRING` configuration parameter (see [Using the .Net Connector](05_using_the_net_connector/#using_the_net_connector) for an introduction to connection information and also see [Connection String Parameters](#connection-string-parameters) for connection parameters). - -```Text -<% @ Page Language="C#" %> -<% @Import Namespace="EnterpriseDB.EDBClient" %> -<% @Import Namespace="System.Configuration" %> - - -``` - -If the connection is successful, a browser will display the following: - -![Connection Opened Successfully](images/connection_opened_successfully.png) - -Connection Opened Successfully - -## Example - Opening a Database Connection from a Console Application - -The following example opens a connection with an Advanced Server database using a console-based application. - -Before writing the code for the console application, create an `app.config` file that stores the connection string to the database. Using a configuration file makes it convenient to update the connection string if the information changes. - -```Text - - - - - - -``` - -Using your text editor of choice, enter the following code sample into a file: - -```Text -using System; -using System.Data; -using EnterpriseDB.EDBClient; -using System.Configuration; - -namespace EnterpriseDB -{ - - class EDB - { - - static void Main(string[] args) - { - string strConnectionString = ConfigurationManager.AppSettings - ["DB_CONN_STRING"]; - - EDBConnection conn = new EDBConnection(strConnectionString); - - try - { - conn.Open(); - Console.WriteLine("Connection Opened Successfully"); - } - - catch(Exception exp) - { - throw new Exception(exp.ToString()); - } - - finally - { - conn.Close(); - } - } - } -} -``` - -Save the file as `EDBConnection-Sample.cs` and compile it with the following command: - -`csc /r:EnterpriseDB.EDBClient.dll /out:Console.exe EDBConnection-Sample.cs` - -Compiling the sample should generate a `Console.exe` file; you can execute the sample code by entering `Console.exe`. When executed, the console should verify that the: - - `Connection Opened Successfully` - -## Example - Opening a Database Connection from a Windows Form Application - -The following example demonstrates opening a database connection using a .NET WinForm application. To use the example, save the following code as `WinForm-Example.cs` in a directory that contains the library files. - -```Text -using System; -using System.Windows.Forms; -using System.Drawing; -using EnterpriseDB.EDBClient; - -namespace EDBTestClient -{ - - class Win_Conn - { - static void Main(string[] args) - { - Form frmMain = new Form(); - Button btnConn = new Button(); - btnConn.Location = new System.Drawing.Point(104, 64); - btnConn.Name = "btnConn"; - btnConn.Text = "Open Connection"; - btnConn.Click += new System.EventHandler(btnConn_Click); - - frmMain.Controls.Add(btnConn); - frmMain.Text = "EnterpriseDB"; - - Application.Run(frmMain); - } - - private static void btnConn_Click(object sender, System.EventArgs e) - { - EDBConnection conn = null; - try - { - string connectionString = "Server=10.90.1.29;port=5444; - username=edb;password=edb;database=edb"; - conn = new EDBConnection(connectionString); - conn.Open(); - MessageBox.Show("Connection Open"); - } - catch(EDBException exp) - { - MessageBox.Show(exp.ToString()); - } - finally - { - conn.Close(); - } - } - } -} -``` - -Note that you must change the database connection string to point to the database that you want to connect to before compiling the file with the following command: - -`csc /r:EnterpriseDB.EDBClient.dll /out:WinForm.exe WinForm-Example.cs` - -This command should generate a `WinForm.exe` file within the same folder that the executable was compiled under. Invoking the executable will display: - -![A successful connection](images/dialog.png) - -A successful connection diff --git a/product_docs/docs/net_connector/4.1.6.1/07_retrieving_database_records.mdx b/product_docs/docs/net_connector/4.1.6.1/07_retrieving_database_records.mdx deleted file mode 100644 index 0992ff98a46..00000000000 --- a/product_docs/docs/net_connector/4.1.6.1/07_retrieving_database_records.mdx +++ /dev/null @@ -1,133 +0,0 @@ ---- -title: "Retrieving Database Records" - -legacyRedirectsGenerated: - # This list is generated by a script. If you need add entries, use the `legacyRedirects` key. - - "/edb-docs/d/edb-postgres-net-connector/user-guides/net-guide/4.1.6.1/retrieving_database_records.html" ---- - - - -You can use a `SELECT` statement to retrieve records from the database via a `SELECT` command. To execute a `SELECT` statement you must: - -- Create and open a database connection. -- Create an `EDBCommand` object that represents the `SELECT` statement. -- Execute the command with the `ExecuteReader()` method of the `EDBCommand` object returning a `EDBDataReader` -- Loop through the `EDBDataReader` displaying the results or binding the `EDBDataReader` to some control. - -An `EDBDataReader` object represents a forward-only and read-only stream of database records, presented one record at a time. To view a subsequent record in the stream, you must call the `Read()` method of the `EDBDataReader` object. - -The example that follows: - -1. Imports the Advanced Server namespace: `EnterpriseDB.EDBClient` -2. Initializes an `EDBCommand` object with a `SELECT` statement. -3. Opens a connection to the database. -4. Executes the `EDBCommand` by calling the `ExecuteReader` method of the `EDBCommand` object. - -The results of the SQL statement are retrieved into an `EDBDataReader` object. - -Loops through the contents of the `EDBDataReader` object to display the records returned by the query within a `WHILE` loop. - -The `Read()` method advances to the next record (if a record exists) and returns `true` if a record exists, or `false` to indicate that the `EDBDataReader` has reached the end of the result set. - -```Text -<% @ Page Language="C#" %> -<% @Import Namespace="EnterpriseDB.EDBClient" %> -<% @Import Namespace="System.Data" %> -<% @Import Namespace="System.Configuration" %> - - -``` - -To exercise the sample code, save the code in your default web root directory in a file named: - - `selectEmployees.aspx` - -To invoke the program, open a web-browser, and browse to: - - `http://localhost/selectEmployees.aspx` - -## Retrieving a Single Database Record - -To retrieve a single result from a query, use the `ExecuteScalar()` method of the `EDBCommand` object. The `ExecuteScalar()` method returns the first value of the first column of the first row of the `DataSet` generated by the specified query. - -```text -<% @ Page Language="C#" %> -<% @Import Namespace="EnterpriseDB.EDBClient" %> -<% @Import Namespace="System.Data" %> -<% @Import Namespace="System.Configuration" %> - - -``` - -Save the sample code in a file in a web root directory named: - - `selectscalar.aspx` - -To invoke the sample code, open a web-browser, and browse to: - - `http://localhost/selectScalar.aspx` - -Please note that the sample includes an explicit conversion of the value returned by the `ExecuteScalar()` method. The `ExecuteScalar()` method returns an object; to view the object, you must convert it into an integer value by using the `Convert.ToInt32` method. diff --git a/product_docs/docs/net_connector/4.1.6.1/08_parameterized_queries.mdx b/product_docs/docs/net_connector/4.1.6.1/08_parameterized_queries.mdx deleted file mode 100644 index 2bad28634c2..00000000000 --- a/product_docs/docs/net_connector/4.1.6.1/08_parameterized_queries.mdx +++ /dev/null @@ -1,66 +0,0 @@ ---- -title: "Parameterized Queries" - -legacyRedirectsGenerated: - # This list is generated by a script. If you need add entries, use the `legacyRedirects` key. - - "/edb-docs/d/edb-postgres-net-connector/user-guides/net-guide/4.1.6.1/parameterized_queries.html" ---- - - - -A `parameterized query` is a query with one or more parameter markers embedded in the SQL statement. Before executing a parameterized query, you must supply a value for each marker found in the text of the SQL statement. - -Parameterized queries are useful when you don't know the complete text of a query at the time you write your code. For example, the value referenced in a `WHERE` clause may be calculated from user input. - -As demonstrated in the following example, you must declare the data type of each parameter specified in the parameterized query by creating an `EDBParameter` object and adding that object to the command's parameter collection. Then, you must specify a `value` for each parameter by calling the parameter's `Value()` function. - -The example demonstrates use of a parameterized query with an `UPDATE` statement that increases an employee salary: - -```text -<% @ Page Language="C#" Debug="true"%> -<% @Import Namespace="EnterpriseDB.EDBClient" %> -<% @Import Namespace="System.Data" %> -<% @Import Namespace="System.Configuration" %> - - -``` - -Save the sample code in a file in a web root directory named: - - `updateSalary.aspx` - -To invoke the sample code, open a web-browser, and browse to: - - `http://localhost/updateSalary.aspx` diff --git a/product_docs/docs/net_connector/4.1.6.1/09_inserting_records_in_a_database.mdx b/product_docs/docs/net_connector/4.1.6.1/09_inserting_records_in_a_database.mdx deleted file mode 100644 index 31716cb6888..00000000000 --- a/product_docs/docs/net_connector/4.1.6.1/09_inserting_records_in_a_database.mdx +++ /dev/null @@ -1,71 +0,0 @@ ---- -title: "Inserting Records in a Database" - -legacyRedirectsGenerated: - # This list is generated by a script. If you need add entries, use the `legacyRedirects` key. - - "/edb-docs/d/edb-postgres-net-connector/user-guides/net-guide/4.1.6.1/inserting_records_in_a_database.html" ---- - - - -You can use the `ExecuteNonQuery()` method of `EDBCommand` to add records to a database stored on an Advanced Server host with an `INSERT` command. - -In the example that follows, the `INSERT` command is stored in the variable cmd. The values prefixed with a colon (`:`) are placeholders for `EDBParameters` that are instantiated, assigned values, and then added to the `INSERT` command's parameter collection in the statements that follow. The `INSERT` command is executed by the `ExecuteNonQuery()` method of the `cmdInsert` object. - -The example adds a new employee to the `emp` table: - -```Text -<% @ Page Language="C#" Debug="true"%> -<% @Import Namespace="EnterpriseDB.EDBClient" %> -<% @Import Namespace="System.Data" %> -<% @Import Namespace="System.Configuration" %> - - -``` - -Save the sample code in a file in a web root directory named: - - `insertEmployee.aspx` - -To invoke the sample code, open a web-browser, and browse to: - - `http://localhost/insertEmployee.aspx` diff --git a/product_docs/docs/net_connector/4.1.6.1/10_deleting_records_in_a_database.mdx b/product_docs/docs/net_connector/4.1.6.1/10_deleting_records_in_a_database.mdx deleted file mode 100644 index dace9fabe76..00000000000 --- a/product_docs/docs/net_connector/4.1.6.1/10_deleting_records_in_a_database.mdx +++ /dev/null @@ -1,72 +0,0 @@ ---- -title: "Deleting Records in a Database" - -legacyRedirectsGenerated: - # This list is generated by a script. If you need add entries, use the `legacyRedirects` key. - - "/edb-docs/d/edb-postgres-net-connector/user-guides/net-guide/4.1.6.1/deleting_records_in_a_database.html" ---- - - - -You can use the `ExecuteNonQuery()` method of `EDBCommand` to delete records from a database stored on an Advanced Server host with a `DELETE` statement. - -In the example that follows, the `DELETE` command is stored in the variable `strDeleteQuery`. The code passes the employee number to the Delete command (specified by: `EmpNo`). The command is then executed using the `ExecuteNonQuery()` method. The following example deletes the employee inserted in the previous example: - -```text -<% @ Page Language="C#" Debug="true"%> -<% @Import Namespace="EnterpriseDB.EDBClient" %> -<% @Import Namespace="System.Data" %> -<% @Import Namespace="System.Configuration" %> - - -``` - -Save the sample code in a file in a web root directory named: - - `deleteEmployee.aspx` - -To invoke the sample code, open a web-browser, and browse to: - - `http://localhost/deleteEmployee.aspx` diff --git a/product_docs/docs/net_connector/4.1.6.1/11_using_spl_stored_procedures_in_your_net_application.mdx b/product_docs/docs/net_connector/4.1.6.1/11_using_spl_stored_procedures_in_your_net_application.mdx deleted file mode 100644 index bebc9943860..00000000000 --- a/product_docs/docs/net_connector/4.1.6.1/11_using_spl_stored_procedures_in_your_net_application.mdx +++ /dev/null @@ -1,420 +0,0 @@ ---- -title: "Using SPL Stored Procedures in your .NET Application" - -legacyRedirectsGenerated: - # This list is generated by a script. If you need add entries, use the `legacyRedirects` key. - - "/edb-docs/d/edb-postgres-net-connector/user-guides/net-guide/4.1.6.1/using_spl_stored_procedures_in_your_net_application.html" ---- - - - -You can include SQL statements in an application in two ways: - -- By adding the SQL statements directly in the .NET application code. -- By packaging the SQL statements in a stored procedure, and executing the stored procedure from the .NET application. - -In some cases, a stored procedure can provide advantages over embedded SQL statements. Stored procedures support complex conditional and looping constructs that are difficult to duplicate with SQL statements embedded directly in an application. - -You can also see a significant improvement in performance by using stored procedures; a stored procedure only needs to be parsed, compiled and optimized once on the server side, while a SQL statement that is included in an application may be parsed, compiled and optimized each time it is executed from a .NET application. - -To use a stored procedure in your .NET application you must: - -1. Create an SPL stored procedure on the Advanced Server host. -2. Import the `EnterpriseDB.EDBClient` namespace. -3. Pass the name of the stored procedure to the instance of the `EDBCommand`. -4. Change the `EDBCommand.CommandType` to `CommandType.StoredProcedure`. -5. `Prepare()` the command. -6. Execute the command. - -## Example - Executing a Stored Procedure without Parameters - -Our sample procedure prints the name of department 10; the procedure takes no parameters, and returns no parameters. To create the sample procedure, invoke EDB-PSQL and connect to the Advanced Server host database. Enter the following SPL code at the command line: - -```Text -CREATE OR REPLACE PROCEDURE list_dept10 -IS - v_deptname VARCHAR2(30); -BEGIN - DBMS_OUTPUT.PUT_LINE('Dept No: 10'); - SELECT dname INTO v_deptname FROM dept WHERE deptno = 10; - DBMS_OUTPUT.PUT_LINE('Dept Name: ' || v_deptname); -END; -``` - -When Advanced Server has validated the stored procedure it will echo `CREATE PROCEDURE`. - -**Using the EDBCommand Object to Execute a Stored Procedure** - -The `CommandType` property of the `EDBCommand` object is used to indicate the type of command being executed. The `CommandType` property is set to one of three possible `CommandType` enumeration values: - -- Use the default `Text` value when passing a SQL string for execution. -- Use the `StoredProcedure` value, passing the name of a stored procedure for execution. -- Use the `TableDirect` value when passing a table name. This value passes back all records in the specified table. - -The `CommandText` property must contain a SQL string, stored procedure name, or table name depending on the value of the `CommandType` property. - -The following example executes the stored procedure: - -```Text -<% @ Page Language="C#" Debug="true"%> -<% @Import Namespace="EnterpriseDB.EDBClient" %> -<% @Import Namespace="System.Data" %> -<% @Import Namespace="System.Configuration" %> - - -``` - -Save the sample code in a file in a web root directory named: - - `storedProc.aspx` - -To invoke the sample code, open a web-browser, and browse to: - - `http://localhost/storedProc.aspx` - -## Example - Executing a Stored Procedure with IN Parameters - -The following example demonstrates calling a stored procedure that includes `IN` parameters. To create the sample procedure, invoke `EDB-PSQL` and connect to the Advanced Server host database. Enter the following SPL code at the command line: - -```Text -CREATE OR REPLACE PROCEDURE - EMP_INSERT - ( - pENAME IN VARCHAR, - pJOB IN VARCHAR, - pSAL IN FLOAT4, - pCOMM IN FLOAT4, - pDEPTNO IN INTEGER, - pMgr IN INTEGER - ) -AS -DECLARE - CURSOR TESTCUR IS SELECT MAX(EMPNO) FROM EMP; - MAX_EMPNO INTEGER := 10; -BEGIN - - OPEN TESTCUR; - FETCH TESTCUR INTO MAX_EMPNO; - INSERT INTO EMP(EMPNO,ENAME,JOB,SAL,COMM,DEPTNO,MGR) - VALUES(MAX_EMPNO+1,pENAME,pJOB,pSAL,pCOMM,pDEPTNO,pMgr); - CLOSE testcur; -END; -``` - -When Advanced Server has validated the stored procedure it wEDBTypes.EDBDbType.Floatill echo `CREATE PROCEDURE`. - -**Passing Input Values to a Stored Procedure** - -Calling a stored procedure that contains parameters is very similar to executing a stored procedure without parameters. The major difference is that when calling a parameterized stored procedure you must use the `EDBParameter` collection of the `EDBCommand` object. When the `EDBParameter` is added to the `EDBCommand` collection, properties such as `ParameterName`, `DbType`, `Direction`, `Size`, and `Value` are set. - -The following example demonstrates the process of executing a parameterized stored procedure from a C#. - -```Text -<% @ Page Language="C#" Debug="true"%> -<% @Import Namespace="EnterpriseDB.EDBClient" %> -<% @Import Namespace="System.Data" %> -<% @Import Namespace="System.Configuration" %> - - - - -``` - -Save the sample code in a file in a web root directory named: - - `storedProcInParam.aspx` - -To invoke the sample code, open a web-browser, and browse to: - - `http://localhost/storedProcInParam.aspx` - -In the example, the body of the `Page_Load` method declares and instantiates an `EDBConnection` object. The sample then creates an `EDBCommand` object with the properties needed to execute the stored procedure. - -The example then uses the `Add` method of the `EDBCommand Parameter` collection to add six input parameters. - -```text -EDBCommand cmdStoredProc = new EDBCommand -("emp_insert(:EmpName,:Job,:Salary,:Commission,:DeptNo,:Manager)",conn); -cmdStoredProc.CommandType = CommandType.StoredProcedure; -``` - -It assigns a value to each parameter before passing them to the `EMP_INSERT` stored procedure - -The `Prepare()` method prepares the statement before calling the `ExecuteNonQuery()` method. - -The `ExecuteNonQuery` method of the `EDBCommand` object executes the stored procedure. After the stored procedure has executed, a test record is inserted into the `emp` table and the values inserted are displayed on the webpage. - -## Example - Executing a Stored Procedure with IN, OUT, and INOUT Parameters - -The previous example demonstrated how to pass `IN` parameters to a stored procedure; the following examples demonstrate how to pass `IN` values and return `OUT` values from a stored procedure. - -**Creating the Stored Procedure** - -The following stored procedure passes the department number, and returns the corresponding location and department name. To create the sample procedure, open the EDB-PSQL command line, and connect to the Advanced Server host database. Enter the following SPL code at the command line: - -```Text -CREATE OR REPLACE PROCEDURE - DEPT_SELECT - ( - pDEPTNO IN INTEGER, - pDNAME OUT VARCHAR, - pLOC OUT VARCHAR - ) -AS -DECLARE - CURSOR TESTCUR IS SELECT DNAME,LOC FROM DEPT; - REC RECORD; -BEGIN - - OPEN TESTCUR; - FETCH TESTCUR INTO REC; - - pDNAME := REC.DNAME; - pLOC := REC.LOC; - - CLOSE testcur; -END; -``` - -When Advanced Server has validated the stored procedure it will echo `CREATE PROCEDURE`. - -**Receiving Output Values from a Stored Procedure** - -When retrieving values from `OUT` parameters you must explicitly specify the direction of out parameters as `Output`. You can retrieve the values from `Output` parameters in two ways: - -- Call the `ExecuteReader` method of the `EDBCommand` and explicitly loop through the returned `EDBDataReader`, searching for the values of `OUT` parameters. -- Call the `ExecuteNonQuery` method of `EDBCommand` and explicitly get the value of a declared `Output` parameter by calling that `EDBParameter` value property. - -In each method, you must declare each parameter, indicating the `direction` of the parameter (`ParameterDirection.Input`, `ParameterDirection.Output` or `ParameterDirection.InputOutput`). Before invoking the procedure, you must provide a value for each `IN` and `INOUT` parameter. After the procedure returns, you may retrieve the `OUT` and `INOUT` parameter values from the `command.Parameters[]` array. - -The following code listing demonstrates using the `ExecuteReader` method to retrieve a result set: - -```Text -<% @ Page Language="C#" Debug="true"%> -<% @Import Namespace="EnterpriseDB.EDBClient" %> -<% @Import Namespace="System.Data" %> -<% @Import Namespace="System.Configuration" %> - - -``` - -The following code listing demonstrates using the `ExecuteNonQuery` method to retrieve a result set: - -```Text -<% @ Page Language="C#" Debug="true"%> -<% @Import Namespace="EnterpriseDB.EDBClient" %> -<% @Import Namespace="System.Data" %> -<% @Import Namespace="System.Configuration" %> - - -``` diff --git a/product_docs/docs/net_connector/4.1.6.1/12_using_advanced_queueing.mdx b/product_docs/docs/net_connector/4.1.6.1/12_using_advanced_queueing.mdx deleted file mode 100644 index 0b8c06478ff..00000000000 --- a/product_docs/docs/net_connector/4.1.6.1/12_using_advanced_queueing.mdx +++ /dev/null @@ -1,492 +0,0 @@ ---- -title: "Using Advanced Queueing" - -legacyRedirectsGenerated: - # This list is generated by a script. If you need add entries, use the `legacyRedirects` key. - - "/edb-docs/d/edb-postgres-net-connector/user-guides/net-guide/4.1.6.1/using_advanced_queueing.html" ---- - - - -EDB Postgres Advanced Server Advanced Queueing provides message queueing and message processing for the Advanced Server database. User-defined messages are stored in a queue; a collection of queues is stored in a queue table. You should first create a queue table before creating a queue that is dependent on it. - -On the server side, procedures in the `DBMS_AQADM` package create and manage message queues and queue tables. Use the `DBMS_AQ` package to add or remove messages from a queue, or register or unregister a PL/SQL callback procedure. For more information about `DBMS_AQ` and `DBMS_AQADM`, click [here](/epas/11/epas_compat_bip_guide/03_built-in_packages/02_dbms_aq/). - -On the client side, application uses EDB.NET driver to enqueue/dequeue message. - -## Enqueueing or Dequeueing a Message - -For more information about using Advanced Servers Advanced Queueing functionality, see the [Database Compatibility for Oracle Developers Built-in Package Guide](/epas/latest/). - -### Server-Side Setup - -To use Advanced Queueing functionality on your .NET application, you must first create a user defined type, queue table, and queue, and then start the queue on the database server. Invoke EDB-PSQL and connect to the Advanced Server host database. Use the following SPL commands at the command line: - -**Creating a User-defined Type** - -To specify a RAW data type, you should create a user-defined type. The following example demonstrates creating a user-defined type named as `myxml`. - -`CREATE TYPE myxml AS (value XML)`; - -**Creating the Queue Table** - -A queue table can hold multiple queues with the same payload type. The following example demonstrates creating a table named `MSG_QUEUE_TABLE`. - -```Text -EXEC DBMS_AQADM.CREATE_QUEUE_TABLE - (queue_table => 'MSG_QUEUE_TABLE', - queue_payload_type => 'myxml', - comment => 'Message queue table'); -END; -``` - -**Creating the Queue** - -The following example demonstrates creating a queue named `MSG_QUEUE` within the table `MSG_QUEUE_TABLE`. - -```Text -BEGIN -DBMS_AQADM.CREATE_QUEUE ( queue_name => 'MSG_QUEUE', queue_table => 'MSG_QUEUE_TABLE', comment => 'This queue contains pending messages.'); -END; -``` - -**Starting the Queue** - -Once the queue is created, invoke the following SPL code at the command line to start a queue in the EDB database. - -```Text -BEGIN -DBMS_AQADM.START_QUEUE -(queue_name => 'MSG_QUEUE'); -END; -``` - -### Client-side Example - -Once you have created a user-defined type, followed by queue table and queue, start the queue. Then, you can enqueue or dequeue a message using EDB .Net drivers. - -**Enqueue a message:** - -To enqueue a message on your .NET application, you must: - -1. Import the `EnterpriseDB.EDBClient` namespace. -2. Pass the name of the queue and create the instance of the `EDBAQQueue`. -3. Create the enqueue message and define a payload. -4. Call the `queue.Enqueue` method. - -The following code listing demonstrates using the `queue.Enqueue` method: - -!!! Note - The following code creates the message and serializes it. This is just an example code and is not going to compile if copied as it is. It is the responsibility of the user to serialize the message as XML. - -```Text -using EnterpriseDB.EDBClient; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace AQXml -{ - class MyXML - { - public string value { get; set; } - } - class Program - { - static void Main(string[] args) - { - int messagesToSend = 1; - if (args.Length > 0 && !string.IsNullOrEmpty(args[0])) - { - messagesToSend = int.Parse(args[0]); - } - for (int i = 0; i < 5; i++) - { - EnqueMsg("test message: " + i); - } - } - - private static EDBConnection GetConnection() - { - string connectionString = "Server=127.0.0.1;Host=127.0.0.1;Port=5444;User Id=enterprisedb;Password=test;Database=edb;Timeout=999"; - EDBConnection connection = new EDBConnection(connectionString); - connection.Open(); - return connection; - } - - - private static string ByteArrayToString(byte[] byteArray) - { - // Sanity check if it's null so we don't incur overhead of an exception - if (byteArray == null) - { - return string.Empty; - } - try - { - StringBuilder hex = new StringBuilder(byteArray.Length * 2); - foreach (byte b in byteArray) - { - hex.AppendFormat("{0:x2}", b); - } - - return hex.ToString().ToUpper(); - } - catch - { - return string.Empty; - } - } - - private static bool EnqueMsg(string msg) - { - EDBConnection con = GetConnection(); - using (EDBAQQueue queue = new EDBAQQueue("MSG_QUEUE", con)) - { - queue.MessageType = EDBAQMessageType.Xml; - EDBTransaction txn = queue.Connection.BeginTransaction(); - QueuedEntities.Message queuedMessage = new QueuedEntities.Message() { MessageText = msg }; - - try - { - string rootElementName = queuedMessage.GetType().Name; - if (rootElementName.IndexOf(".") != -1) - { - rootElementName = rootElementName.Split('.').Last(); - } - - string xml = new Utils.XmlFragmentSerializer().Serialize(queuedMessage); - EDBAQMessage queMsg = new EDBAQMessage(); - queMsg.Payload = new MyXML { value = xml }; - queue.MessageType = EDBAQMessageType.Udt; - queue.UdtTypeName = "myxml"; - queue.Enqueue(queMsg); - var messageId = ByteArrayToString((byte[])queMsg.MessageId); - Console.WriteLine("MessageID: " + messageId); - txn.Commit(); - queMsg = null; - xml = null; - rootElementName = null; - return true; - } - catch (Exception ex) - { - txn?.Rollback(); - Console.WriteLine("Failed to enqueue message."); - Console.WriteLine(ex.ToString()); - return false; - } - finally - { - queue?.Connection?.Dispose(); - } - } - } - - } -} -``` - -**Dequeueing a message** - -To dequeue a message on your .NET application, you must: - -1. Import the `EnterpriseDB.EDBClient` namespace. -2. Pass the name of the queue and create the instance of the `EDBAQQueue`. -3. Call the `queue.Dequeue` method. - -!!! Note - The following code creates the message and serializes it. This is just an example code and is not going to compile if copied as it is. It is the responsibility of the user to serialize the message as XML. - -```Text -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using EnterpriseDB.EDBClient; - -namespace DequeueXML -{ - class MyXML - { - public string value { get; set; } - } - class Program - { - static void Main(string[] args) - { - DequeMsg(); - } - - - private static EDBConnection GetConnection() - { - string connectionString = "Server=127.0.0.1;Host=127.0.0.1;Port=5444;User Id=enterprisedb;Password=test;Database=edb;Timeout=999"; - EDBConnection connection = new EDBConnection(connectionString); - connection.Open(); - return connection; - } - - - private static string ByteArrayToString(byte[] byteArray) - { - // Sanity check if it's null so we don't incur overhead of an exception - if (byteArray == null) - { - return string.Empty; - } - try - { - StringBuilder hex = new StringBuilder(byteArray.Length * 2); - foreach (byte b in byteArray) - { - hex.AppendFormat("{0:x2}", b); - } - - return hex.ToString().ToUpper(); - } - catch - { - return string.Empty; - } - } - public static void DequeMsg(int waitTime = 10) - { - EDBConnection con = GetConnection(); - using (EDBAQQueue queueListen = new EDBAQQueue("MSG_QUEUE", con)) - { - queueListen.UdtTypeName = "myxml"; - queueListen.DequeueOptions.Navigation = EDBAQNavigationMode.FIRST_MESSAGE; - queueListen.DequeueOptions.Visibility = EDBAQVisibility.ON_COMMIT; - queueListen.DequeueOptions.Wait = 1; - EDBTransaction txn = null; - - while (1 == 1) - { - - if (queueListen.Connection.State == System.Data.ConnectionState.Closed) - { - queueListen.Connection.Open(); - } - - string messageId = "Unknown"; - try - { - // the listen function is a blocking function. It will Wait the specified waitTime or until a - // message is received. - Console.WriteLine("Listening..."); - string v = queueListen.Listen(null, waitTime); - // If we are waiting for a message and we specify a Wait time, - // then if there are no more messages, we want to just bounce out. - if (waitTime > -1 && v == null) - { - Console.WriteLine("No message received during Wait period."); - Console.WriteLine(); - continue; - } - - // once we're here that means a message has been detected in the queue. Let's deal with it. - txn = queueListen.Connection.BeginTransaction(); - - Console.WriteLine("Attempting to dequeue message..."); - // dequeue the message - EDBAQMessage deqMsg; - try - { - deqMsg = queueListen.Dequeue(); - } - catch (Exception ex) - { - if (ex.Message.Contains("ORA-25228")) - { - Console.WriteLine("Message was not there. Another process must have picked it up."); - Console.WriteLine(); - txn.Rollback(); - continue; - } - else - { - throw; - } - } - - messageId = ByteArrayToString((byte[])deqMsg.MessageId); - if (deqMsg != null) - { - Console.WriteLine("Processing received message..."); - // process the message payload - MyXML obj = new MyXML(); - queueListen.Map(deqMsg.Payload, obj); - - QueuedEntities.Message msg = new Utils.XmlFragmentSerializer().Deserialize(obj.value); - - Console.WriteLine("Received Message:"); - Console.WriteLine("MessageID: " + messageId); - Console.WriteLine("Message: " + msg.MessageText); - Console.WriteLine("Enqueue Time" + queueListen.MessageProperties.EnqueueTime); - - txn.Commit(); - - Console.WriteLine("Finished processing message"); - Console.WriteLine(); - - } - else - { - Console.WriteLine("Message was not dequeued."); - } - } - catch (Exception ex) - { - Console.WriteLine("Failed To dequeue or process the dequeued message."); - Console.WriteLine(ex.ToString()); - Console.WriteLine(); - if (txn != null) - { - txn.Rollback(); - if (txn != null) - { - txn.Dispose(); - } - } - } - } - } - - } - } -} -``` - -## EDBAQ Classes - -The following EDBAQ classes are used in this application: - -**EDBAQDequeueMode** - -The `EDBAQDequeueMode` class lists all the dequeuer modes available. - -| **Value** | **Description** | -| ------------- | ------------------------------------------------------------- | -| Browse | Read the message without locking. | -| Locked | Reads and gets a write lock on the message. | -| Remove | Deletes the message after reading. This is the default value. | -| Remove_NoData | Confirms receipt of the message. | - -**EDBAQDequeueOptions** - -The `EDBAQDequeueOptions` class lists the options available when dequeuing a message. - -| **Property** | **Description** | -| -------------- | ------------------------------------------------------------------------------------------------------------------------------ | -| ConsumerName | The name of the consumer for which to dequeue the message. | -| DequeueMode | This is set from EDBAQDequeueMode. It represents the locking behavior linked with the dequeue option. | -| Navigation | This is set from EDBAQNavigationMode. It represents the position of the message that will be fetched. | -| Visibility | This is set from EDBAQVisibility. It represents whether the new message is dequeued or not as part of the current transaction. | -| Wait | The wait time for a message as per the search criteria. | -| Msgid | The message identifier. | -| Correlation | The correlation identifier. | -| DeqCondition | The dequeuer condition. It is a Boolean expression. | -| Transformation | The transformation that will be applied before dequeuing the message. | -| DeliveryMode | The delivery mode of the dequeued message. | - -**EDBAQEnqueueOptions** - -The `EDBAQEnqueueOptions` class lists the options available when enqueuing a message. - -| **Property** | **Description** | -| ----------------- | ------------------------------------------------------------------------------------------------------------------------------ | -| Visibility | This is set from EDBAQVisibility. It represents whether the new message is enqueued or not as part of the current transaction. | -| RelativeMsgid | The relative message identifier. | -| SequenceDeviation | The sequence when the message should be dequeued. | -| Transformation | The transformation that will be applied before enqueuing the message. | -| DeliveryMode | The delivery mode of the enqueued message. | - -**EDBAQMessage** - -The `EDBAQMessage` class lists a message to be enqueued/dequeued. - -| **Property** | **Description** | -| ------------ | -------------------------------- | -| Payload | The actual message to be queued. | -| MessageId | The ID of the queued message. | - -**EDBAQMessageProperties** - -The `EDBAQMessageProperties` lists the message properties available. - -| **Property** | **Description** | -| ---------------- | --------------------------------------------------------------------------------------------- | -| Priority | The priority of the message. | -| Delay | The duration post which the message is available for dequeuing. This is specified in seconds. | -| Expiration | The duration for which the message is available for dequeuing. This is specified in seconds. | -| Correlation | The correlation identifier. | -| Attempts | The number of attempts taken to dequeue the message. | -| RecipientList | The receipients list that overthrows the default queue subscribers. | -| ExceptionQueue | The name of the queue where the unprocessed messages should be moved. | -| EnqueueTime | The time when the message was enqueued. | -| State | The state of the message while dequeue. | -| OriginalMsgid | The message identifier in the last queue. | -| TransactionGroup | The transaction group for the dequeued messages. | -| DeliveryMode | The delivery mode of the dequeued message. | - -**EDBAQMessageState** - -The `EDBAQMessageState` class represents the state of the message during dequeue. - -| **Value** | **Description** | -| --------- | ---------------------------------------------------------- | -| Expired | The message is moved to the exception queue. | -| Processed | The message is processed and kept. | -| Ready | The message is ready to be processed. | -| Waiting | The message is in waiting state. The delay is not reached. | - -**EDBAQMessageType** - -The `EDBAQMessageType` class represents the types for payload. - -| **Value** | **Description** | -| --------- | ------------------------------------------------------------------------------------- | -| Raw | The raw message type.

Note: Currently, this payload type is not supported. | -| UDT | The user defined type message. | -| XML | The XML type message.

Note: Currently, this payload type is not supported. | - -**EDBAQNavigationMode** - -The `EDBAQNavigationMode` class represents the different types of navigation modes available. - -| **Value** | **Description** | -| ---------------- | ------------------------------------------------------------------ | -| First_Message | Returns the first available message that matches the search terms. | -| Next_Message | Returns the next available message that matches the search items. | -| Next_Transaction | Returns the first message of next transaction group. | - -**EDBAQQueue** - -The `EDBAQQueue` class represents a SQL statement to execute `DMBS_AQ` functionality on a PostgreSQL database. - -| **Property** | **Description** | -| ----------------- | --------------------------------------------------------------------------------------------- | -| Connection | The connection to be used. | -| Name | The name of the queue. | -| MessageType | The message type that is enqueued/dequeued from this queue. For example EDBAQMessageType.Udt. | -| UdtTypeName | The user defined type name of the message type. | -| EnqueueOptions | The enqueue options to be used. | -| DequeuOptions | The dequeue options to be used. | -| MessageProperties | The message properties to be used. | - -**EDBAQVisibility** - -The `EDBAQVisibility` class represents the visibility options available. - -| **Value** | **Description** | -| --------- | ----------------------------------------------------------- | -| Immediate | The enqueue/dequeue is not part of the ongoing transaction. | -| On_Commit | The enqueue/dequeue is part of the current transaction. | - -!!! Note - - To review the default options for the above parameters, click [here](/epas/11/epas_compat_bip_guide/03_built-in_packages/02_dbms_aq/). - - EDB Advanced Queueing functionality uses user-defined types for calling enqueue/dequeue operations. `Server Compatibility Mode=NoTypeLoading` cannot be used with Advanced Queueing because `NoTypeLoading` will not load any user-defined types. diff --git a/product_docs/docs/net_connector/4.1.6.1/13_using_a_ref_cursor_in_a_net_application.mdx b/product_docs/docs/net_connector/4.1.6.1/13_using_a_ref_cursor_in_a_net_application.mdx deleted file mode 100644 index 3a80106976b..00000000000 --- a/product_docs/docs/net_connector/4.1.6.1/13_using_a_ref_cursor_in_a_net_application.mdx +++ /dev/null @@ -1,108 +0,0 @@ ---- -title: "Using a Ref Cursor in a .NET Application" - -legacyRedirectsGenerated: - # This list is generated by a script. If you need add entries, use the `legacyRedirects` key. - - "/edb-docs/d/edb-postgres-net-connector/user-guides/net-guide/4.1.6.1/using_a_ref_cursor_in_a_net_application.html" ---- - - - -A `ref cursor` is a cursor variable that contains a pointer to a query result set. The result set is determined by the execution of the `OPEN FOR` statement using the cursor variable. A cursor variable is not tied to a particular query like a static cursor. The same cursor variable may be opened a number of times with the `OPEN FOR` statement containing different queries and each time, a new result set will be created for that query and made available via the cursor variable. There are two ways to declare a cursor variable: - -- Use the `SYS_REFCURSOR` built-in data type to declare a weakly-typed ref cursor. -- Define a strongly-typed ref cursor that declares a variable of that type. - -`SYS_REFCURSOR` is a ref cursor type that allows any result set to be associated with it. This is known as a weakly-typed ref cursor. The following example is a declaration of a weakly-typed ref cursor: - - `name SYS_REFCURSOR`; - -Following is an example of a strongly-typed ref cursor: - - `TYPE IS REF CURSOR RETURN emp%ROWTYPE`; - -**Creating the Stored Procedure** - -The following sample code creates a stored procedure called `refcur_inout_callee`. It specifies the data type of the ref cursor being passed as an OUT parameter. To create the sample procedure, invoke EDB-PSQL and connect to the Advanced Server host database. Enter the following SPL code at the command line: - -```Text -CREATE OR REPLACE PROCEDURE - refcur_inout_callee(v_refcur OUT SYS_REFCURSOR) -IS -BEGIN - OPEN v_refcur FOR SELECT ename FROM emp; -END; -``` - -The following C# code uses the stored procedure to retrieve employee names from the `emp` table: - -```Text -using System; -using System.Data; -using EnterpriseDB.EDBClient; -using System.Configuration; - -namespace EDBRefCursor -{ - class EmpRefcursor - { - [STAThread] - static void Main(string[] args) - { - string strConnectionString = - ConfigurationManager.AppSettings["DB_CONN_STRING"]; - EDBConnection conn = new EDBConnection(strConnectionString); - conn.Open(); - try - { - EDBTransaction tran = conn.BeginTransaction(); - EDBCommand command = new EDBCommand("refcur_inout_callee", - conn); - command.CommandType = CommandType.StoredProcedure; - command.Transaction = tran; - command.Parameters.Add(new EDBParameter("refCursor", - EDBTypes.EDBDbType.Refcursor, 10, "refCursor", - - ParameterDirection.Output, false, 2, 2, - System.Data.DataRowVersion.Current, null)); - - command.Prepare(); - command.Parameters[0].Value = null; - - command.ExecuteNonQuery(); - String cursorName = command.Parameters[0].Value.ToString(); - command.CommandText = "fetch all in \"" + cursorName + "\""; - command.CommandType = CommandType.Text; - - EDBDataReader reader = - command.ExecuteReader(CommandBehavior.SequentialAccess); - int fc = reader.FieldCount; - while (reader.Read()) - { - for (int i = 0; i < fc; i++) - { - Console.WriteLine(reader.GetString(i)); - } - } - reader.Close(); - tran.Commit(); - } - catch (Exception ex) - { - Console.WriteLine(ex.Message.ToString()); - } - } - } -} -``` - -The following .NET code snippet displays the result on the console: - -```Text -for(int i = 0;i < fc; i++) -{ - Console.WriteLine(reader.GetString(i)); -} -``` - -Please note that you must bind the `EDBDbType.RefCursor` type in `EDBParameter()` if you are using a ref cursor parameter. diff --git a/product_docs/docs/net_connector/4.1.6.1/14_using_plugins.mdx b/product_docs/docs/net_connector/4.1.6.1/14_using_plugins.mdx deleted file mode 100644 index ce51e374e1e..00000000000 --- a/product_docs/docs/net_connector/4.1.6.1/14_using_plugins.mdx +++ /dev/null @@ -1,256 +0,0 @@ ---- -title: "Using Plugins" - -legacyRedirectsGenerated: - # This list is generated by a script. If you need add entries, use the `legacyRedirects` key. - - "/edb-docs/d/edb-postgres-net-connector/user-guides/net-guide/4.1.6.1/using_plugins.html" ---- - - - -EDB .Net driver plugins are introduced to support the enhanced capabilities for different data types, which are otherwise not available in .Net. The different plugins available support: - -- GeoJSON -- Json.NET -- Legacy PostGIS -- NetTopologySuite -- NodaTime -- Rawpostgis - -The plugins support the use of spatial, data/time and Json types. The following sections detail the supported frameworks and data provider installation path for these plugins. - -## GeoJSON - -If you are using the GeoJSON plugin on .NET Framework 4.6.1, the data provider installation path is: - - `C:\Program Files\edb\dotnet\plugins\GeoJSON\net461` - -The following shared library files are required: - - `EnterpriseDB.EDBClient.GeoJSON.dll` - `GeoJSON.Net.dll` - `Newtonsoft.Json.dll` - -If you are using the GeoJSON plugin on .NET Framework 4.7.2, the data provider installation path is: - - `C:\Program Files\edb\dotnet\plugins\GeoJSON\net472` - -The following shared library files are required: - - `EnterpriseDB.EDBClient.GeoJSON.dll` - `GeoJSON.Net.dll` - `Newtonsoft.Json.dll` - -If you are using the GeoJSON plugin on .NET Framework 4.8, the data provider installation path is: - - `C:\Program Files\edb\dotnet\plugins\GeoJSON\net48` - -The following shared library files are required: - - `EnterpriseDB.EDBClient.GeoJSON.dll` - `GeoJSON.Net.dll` - `Newtonsoft.Json.dll` - -If you are using the GeoJSON plugin on .NET Standard 2.0, the data provider installation path is: - - `C:\Program Files\edb\dotnet\plugins\GeoJSON\netstandard2.0` - -The following shared library files are required: - -`EnterpriseDB.EDBClient.GeoJSON.dll` - -For detailed information about using the GeoJSON plugin, see the [Npgsql documentation](http://www.npgsql.org/doc/types/geojson.html). - -## Json.NET - -If you are using the Json.NET plugin on .NET Framework 4.6.1, the data provider installation path is: - - `C:\Program Files\edb\dotnet\plugins\Json.NET\net461` - -The following shared library files are required: - - `EnterpriseDB.EDBClient.Json.NET.dll` - `Newtonsoft.Json.dll` - -If you are using the Json.NET plugin on .NET Framework 4.7.2, the data provider installation path is: - - `C:\Program Files\edb\dotnet\plugins\Json.NET\net472` - -The following shared library files are required: - - `EnterpriseDB.EDBClient.Json.NET.dll` - `Newtonsoft.Json.dll` - -If you are using the Json.NET plugin on .NET Framework 4.8, the data provider installation path is: - - `C:\Program Files\edb\dotnet\plugins\Json.NET\net48` - -The following shared library files are required: - - `EnterpriseDB.EDBClient.Json.NET.dll` - `Newtonsoft.Json.dll` - -If you are using the Json.NET plugin on .NET Standard 2.0, the data provider installation path is: - - `C:\Program Files\edb\dotnet\plugins\Json.NET\netstandard2.0` - -The following shared library files are required: - -`EnterpriseDB.EDBClient.Json.NET.dll` - -For detailed information about using the Json.NET plugin, see the [Npgsql documentation](http://www.npgsql.org/doc/types/jsonnet.html). - -## LegacyPostGIS - -If you are using the LegacyPostGIS plugin on .Net Framework 4.6.1, the data provider installation path is: - - `C:\Program Files\edb\dotnet\plugins\LegacyPostgis\net461` - -The following shared library files are required: - - `EnterpriseDB.EDBClient.LegacyPostgis.dll` - -If you are using the LegacyPostGIS plugin on .Net Framework 4.7.2, the data provider installation path is: - - `C:\Program Files\edb\dotnet\plugins\LegacyPostgis\net472` - -The following shared library files are required: - - `EnterpriseDB.EDBClient.LegacyPostgis.dll` - -If you are using the LegacyPostGIS plugin on .Net Framework 4.8, the data provider installation path is: - - `C:\Program Files\edb\dotnet\plugins\LegacyPostgis\net48` - -The following shared library files are required: - - `EnterpriseDB.EDBClient.LegacyPostgis.dll` - -If you are using the LegacyPostGIS plugin on .Net Standard 2.0, the data provider installation path is: - - `C:\Program Files\edb\dotnet\plugins\LegacyPostgis\netstandard2.0` - -The following shared library files are required: - - `EnterpriseDB.EDBClient.LegacyPostgis.dll` - -For detailed information about using the LegacyPostGIS plugin, see the [Npgsql documentation](http://www.npgsql.org/doc/types/legacy-postgis.html). - -## NetTopologySuite - -If you are using the NetTopologySuite plugin on .Net Framework 4.6.1, the data provider installation path is: - - `C:\Program Files\edb\dotnet\plugins\NetTopologySuite\net461` - -The following shared library files are required: - - `EnterpriseDB.EDBClient.NetTopologySuite.dll` - `NetTopologySuite.dll` - `NetTopologySuite.IO.PostGis.dll` - -If you are using the NetTopologySuite plugin on .Net Framework 4.7.2, the data provider installation path is: - - `C:\Program Files\edb\dotnet\plugins\NetTopologySuite\net472` - -The following shared library files are required: - - `EnterpriseDB.EDBClient.NetTopologySuite.dll` - `GeoAPI.dll` - `NetTopologySuite.dll` - `NetTopologySuite.IO.PostGis.dll` - -If you are using the NetTopologySuite plugin on .Net Framework 4.8, the data provider installation path is: - - `C:\Program Files\edb\dotnet\plugins\NetTopologySuite\net48` - -The following shared library files are required: - - `EnterpriseDB.EDBClient.NetTopologySuite.dll` - `GeoAPI.dll` - `NetTopologySuite.dll` - `NetTopologySuite.IO.PostGis.dll` - -If you are using the NetTopologySuite plugin on .Net Standard 2.0, the data provider installation path is: - - `C:\Program Files\edb\dotnet\plugins\NetTopologySuite\netstandard2.0` - -The following shared library files are required: - - `EnterpriseDB.EDBClient.NetTopologySuite.dll` - -For detailed information about using the NetTopologySuite type plugin, see the [Npgsql documentation](http://www.npgsql.org/doc/types/nts.html). - -## NodaTime - -If you are using the NodaTime plugin on .Net Framework 4.6.1, the data provider installation path is: - - `C:\Program Files\edb\dotnet\plugins\NodaTime\net461` - -The following shared library files are required: - - `EnterpriseDB.EDBClient.NodaTime.dll` - `NodaTime.dll` - -If you are using the NodaTime plugin on .Net Framework 4.7.2, the data provider installation path is: - - `C:\Program Files\edb\dotnet\plugins\NodaTime\net472` - -The following shared library files are required: - - `EnterpriseDB.EDBClient.NodaTime.dll` - `NodaTime.dll` - -If you are using the NodaTime plugin on .Net Framework 4.8, the data provider installation path is: - - `C:\Program Files\edb\dotnet\plugins\NodaTime\net48` - -The following shared library files are required: - - `EnterpriseDB.EDBClient.NodaTime.dll` - `NodaTime.dll` - -If you are using the NodaTime plugin on .Net Standard 2.0, the data provider installation path is: - - `C:\Program Files\edb\dotnet\plugins\NodaTime\netstandard2.0` - -The following shared library files are required: - - `EnterpriseDB.EDBClient.NodaTime.dll` - -For detailed information about using the NodaTime plugin, see the [Npgsql documentation](http://www.npgsql.org/doc/types/nodatime.html). - -## RawPostGIS - -If you are using the RawPostGIS plugin on .Net Framework 4.6.1, the data provider installation path is: - - `C:\Program Files\edb\dotnet\plugins\RawPostgis\net461` - -The following shared library files are required: - - `EnterpriseDB.EDBClient.RawPostgis.dll` - -If you are using the RawPostGIS plugin on .Net Framework 4.7.2, the data provider installation path is: - - `C:\Program Files\edb\dotnet\plugins\RawPostgis\net472` - -The following shared library files are required: - - `EnterpriseDB.EDBClient.RawPostgis.dll` - -If you are using the RawPostGIS plugin on .Net Framework 4.8, the data provider installation path is: - - `C:\Program Files\edb\dotnet\plugins\RawPostgis\net48` - -The following shared library files are required: - - `EnterpriseDB.EDBClient.RawPostgis.dll` - -If you are using the RawPostGIS type plugin on .Net Standard 2.0, the data provider installation path is: - - `C:\Program\Files\edb\dotnet\plugins\RawPostGis\netstandard2.0` - -The following shared library files are required: - - `EnterpriseDB.EDBClient.RawPostgis.dll` - -For detailed information about using the RawPostGIS plugin, see the [documentation](https://www.nuget.org/packages/Npgsql.RawPostgis). diff --git a/product_docs/docs/net_connector/4.1.6.1/15_using_object_types.mdx b/product_docs/docs/net_connector/4.1.6.1/15_using_object_types.mdx deleted file mode 100644 index 124df13ec48..00000000000 --- a/product_docs/docs/net_connector/4.1.6.1/15_using_object_types.mdx +++ /dev/null @@ -1,190 +0,0 @@ ---- -title: "Using Object Types in .NET" - -legacyRedirectsGenerated: - # This list is generated by a script. If you need add entries, use the `legacyRedirects` key. - - "/edb-docs/d/edb-postgres-net-connector/user-guides/net-guide/4.1.6.1/using_object_types.html" ---- - - - -The SQL `CREATE TYPE` command is used to create a user-defined `object type`, which is stored in the Advanced Server database. - -These user-defined types can then be referenced within SPL procedures, SPL functions, and .NET programs. - -The basic object type is created with the `CREATE TYPE AS OBJECT` command along with optional usage of the `CREATE TYPE BODY` command. - -An example that demonstrates using an object type is shown in the following section. - -## Using an Object Type - -To use an object type, you must first create the object type in the Advanced Server database. Object type `addr_object_type` defines the attributes of an address: - -```text -CREATE OR REPLACE TYPE addr_object_type AS OBJECT -( - street VARCHAR2(30), - city VARCHAR2(20), - state CHAR(2), - zip NUMBER(5) -); -``` - -Object type `emp_obj_typ` defines the attributes of an employee. Note that one of these attributes is object type `ADDR_OBJECT_TYPE` as previously described. The object type body contains a method that displays the employee information: - -```text -CREATE OR REPLACE TYPE emp_obj_typ AS OBJECT -( - empno NUMBER(4), - ename VARCHAR2(20), - addr ADDR_OBJECT_TYPE, - MEMBER PROCEDURE display_emp(SELF IN OUT emp_obj_typ) -); - -CREATE OR REPLACE TYPE BODY emp_obj_typ AS - MEMBER PROCEDURE display_emp (SELF IN OUT emp_obj_typ) - IS - BEGIN - DBMS_OUTPUT.PUT_LINE('Employee No : ' || SELF.empno); - DBMS_OUTPUT.PUT_LINE('Name : ' || SELF.ename); - DBMS_OUTPUT.PUT_LINE('Street : ' || SELF.addr.street); - DBMS_OUTPUT.PUT_LINE('City/State/Zip: ' || SELF.addr.city || ', ' || - SELF.addr.state || ' ' || LPAD(SELF.addr.zip,5,'0')); - END; -END; -``` - -The following listing is a complete .NET program that uses these user-defined object types: - -```text -namespace ObjectTypesSample -{ - class Program - { - static void Main(string[] args) - { - EDBConnection.GlobalTypeMapper.MapComposite("enterprisedb.addr_object_type"); - EDBConnection.GlobalTypeMapper.MapComposite("enterprisedb.emp_obj_typ"); - EDBConnection conn = new EDBConnection("Server=localhost;Port=5444;database=test;User ID=enterprisedb;password=;"); - - try - { - conn.Open(); - - EDBCommand cmd = new EDBCommand("emp_obj_typ.display_emp", conn); - - cmd.CommandType = System.Data.CommandType.StoredProcedure; - EDBCommandBuilder.DeriveParameters(cmd); - - addr_object_type address = new addr_object_type() - { - street = "123 MAIN STREET", - city = "EDISON", - state = "NJ", - zip = 8817 - }; - - emp_obj_typ emp = new emp_obj_typ() - { - empno = 9001, - ename = "JONES", - addr = address - }; - cmd.Parameters[0].Value = emp; - cmd.Prepare(); - cmd.ExecuteNonQuery(); - - emp_obj_typ empOut = (emp_obj_typ)cmd.Parameters[0].Value; - Console.WriteLine("Emp No: " + empOut.empno); - Console.WriteLine("Emp Name: " + empOut.ename); - Console.WriteLine("Emp Address Street: " + empOut.addr.street); - Console.WriteLine("Emp Address City: " + empOut.addr.city); - Console.WriteLine("Emp Address State: " + empOut.addr.state); - Console.WriteLine("Emp Address Zip: " + empOut.addr.zip); - Console.WriteLine("Emp No: " + empOut.empno); - } - catch (EDBException exp) - { - Console.WriteLine(exp.Message.ToString()); - } - finally - { - conn.Close(); - } - } - } - - public class addr_object_type - { - public string street; - public string city; - public string state; - public decimal zip; - } - - public class emp_obj_typ - { - public decimal empno; - public string ename; - public addr_object_type addr; - } -} -``` - -The following .NET types are defined to map to the types in Advanced Server: - -```text -public class addr_object_type -{ - public string street; - public string city; - public string state; - public decimal zip; -} - -public class emp_obj_typ -{ - public decimal empno; - public string ename; - public addr_object_type addr; -} -``` - -A call to `EDBConnection.GlobalTypeMapper.MapComposite` maps the .NET type to the Advanced Server types: - -```text -EDBConnection.GlobalTypeMapper.MapComposite("enterprisedb.addr_object_type"); - EDBConnection.GlobalTypeMapper.MapComposite("enterprisedb.emp_obj_typ"); -``` - -A call to `EDBCommandBuilder.DeriveParameters()` gets parameter information for a stored procedure. This allows you to just set the parameter values and call the stored procedure: - -```text -EDBCommandBuilder.DeriveParameters(cmd); -``` - -The value of the parameter is set by creating an object of the .NET type and assigning it to the `Value` property of the parameter: - -```text -addr_object_type address = new addr_object_type() -{ - street = "123 MAIN STREET", - city = "EDISON", - state = "NJ", - zip = 8817 -}; - -emp_obj_typ emp = new emp_obj_typ() -{ - empno = 9001, - ename = "JONES", - addr = address -}; -cmd.Parameters[0].Value = emp; -``` - -A call to `cmd.ExecuteNonQuery()` executes the call to the `display_emp()` method: - -```text -cmd.ExecuteNonQuery(); -``` diff --git a/product_docs/docs/net_connector/4.1.6.1/16_scram_compatibility.mdx b/product_docs/docs/net_connector/4.1.6.1/16_scram_compatibility.mdx deleted file mode 100644 index 2d14e010cbb..00000000000 --- a/product_docs/docs/net_connector/4.1.6.1/16_scram_compatibility.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -title: "Scram Compatibility" -legacyRedirects: - - "/edb-docs/d/edb-postgres-net-connector/user-guides/net-guide/4.1.6.1/security_and_encryption.html" - -legacyRedirectsGenerated: - # This list is generated by a script. If you need add entries, use the `legacyRedirects` key. - - "/edb-docs/d/edb-postgres-net-connector/user-guides/net-guide/4.1.6.1/scram_compatibility.html" ---- - - - -The EDB .NET driver provides SCRAM-SHA-256 support for Advanced Server version 10 and above. This support is available from EDB .NET 4.0.2.1 release onwards. diff --git a/product_docs/docs/net_connector/4.1.6.1/17_advanced_server_net_connector_logging.mdx b/product_docs/docs/net_connector/4.1.6.1/17_advanced_server_net_connector_logging.mdx deleted file mode 100644 index ea7fe3ffb6f..00000000000 --- a/product_docs/docs/net_connector/4.1.6.1/17_advanced_server_net_connector_logging.mdx +++ /dev/null @@ -1,107 +0,0 @@ ---- -title: "EDB .NET Connector Logging" - -legacyRedirectsGenerated: - # This list is generated by a script. If you need add entries, use the `legacyRedirects` key. - - "/edb-docs/d/edb-postgres-net-connector/user-guides/net-guide/4.1.6.1/advanced_server_net_connector_logging.html" ---- - - - -EDB .NET Connector supports the use of logging to help resolve issues with the .NET Connector when used in your application. The connector uses classes in the `EnterpriseDB.EDBClient.Logging` namespace for logging. - -**Console Logging to Standard Error** - -`EnterpriseDB.EDBClient.Logging.ConsoleLoggingProvider` is a class that outputs error messages to `STDERR`. To use this class, include the following line in your application before using any of the Advanced Server .NET Connector APIs. - -`EnterpriseDB.EDBClient.Logging.EDBLogManager.Provider = new EnterpriseDB.EDBClient.Logging.ConsoleLoggingProvider(EDBLogLevel.Debug, true, true);` - -The following log levels are available: - -- Trace -- Debug -- Info -- Warn -- Error -- Fatal - -**Writing a Custom Logger** - -If the console logging provider does not fulfill your requirements, you can write a custom logger by implementing the `EnterpriseDB.EDBClient.Logging.IEDBLoggingProvider` interface, and extending the `EnterpriseDB.EDBClient.Logging.EDBLogger` class, for instance, writing your logs to a file. The following is a simple example of how to write a custom logger: - -```text -public class MyLoggingProvider : IEDBLoggingProvider - { - string _logFile; - readonly EDBLogLevel _minLevel; - readonly bool _printLevel; - readonly bool _printConnectorId; - - public MyLoggingProvider(string logFile, EDBLogLevel minLevel = EDBLogLevel.Info, bool printLevel = false, bool printConnectorId = false) - { - _logFile = logFile; - _minLevel = minLevel; - _printLevel = printLevel; - _printConnectorId = printConnectorId; - } - - public EDBLogger CreateLogger(string name) - { - return new MyLogger(_logFile, _minLevel, _printLevel, _printConnectorId); - } - } - - class MyLogger : EDBLogger - { - string _logFile; - readonly EDBLogLevel _minLevel; - readonly bool _printLevel; - readonly bool _printConnectorId; - - internal MyLogger(string logFile, EDBLogLevel minLevel, bool printLevel, bool printConnectorId) - { - _logFile = logFile; - _minLevel = minLevel; - _printLevel = printLevel; - _printConnectorId = printConnectorId; - } - - public override bool IsEnabled(EDBLogLevel level) => level >= _minLevel; - - public override void Log(EDBLogLevel level, int connectorId, string msg, Exception exception = null) - { - if (!IsEnabled(level)) - return; - - - using (StreamWriter writer = new StreamWriter(_logFile, true)) - { - var sb = new StringBuilder(); - if (_printLevel) - { - sb.Append(level.ToString().ToUpper()); - sb.Append(' '); - } - - if (_printConnectorId && connectorId != 0) - { - sb.Append("["); - sb.Append(connectorId); - sb.Append("] "); - } - - sb.AppendLine(msg); - - if (exception != null) - sb.AppendLine(exception.ToString()); - - writer.Write(sb.ToString()); - } - - } - } -``` - -To use this custom logger, put the following line in your application before using any of the EDB .NET Connector APIs: - -`EDBLogManager.Provider = new MyLoggingProvider(filepath, EDBLogLevel.Debug, true, true);` diff --git a/product_docs/docs/net_connector/4.1.6.1/18_api_reference.mdx b/product_docs/docs/net_connector/4.1.6.1/18_api_reference.mdx deleted file mode 100644 index 2eb61b0f57b..00000000000 --- a/product_docs/docs/net_connector/4.1.6.1/18_api_reference.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -title: "API Reference" - -legacyRedirectsGenerated: - # This list is generated by a script. If you need add entries, use the `legacyRedirects` key. - - "/edb-docs/d/edb-postgres-net-connector/user-guides/net-guide/4.1.6.1/api_reference.html" ---- - - - -For information about using the API, see the [Npgsql documentation](http://www.npgsql.org/doc/api/Npgsql.html). - -Usage notes: - -- When using the API, replace references to `Npgsql` with `EnterpriseDB.EDBClient`. -- When referring to classes, replace `Npgsql` with `EDB`. For example, use the `EDBBinaryExporter` class instead of the `NpgsqlBinaryExporter` class. diff --git a/product_docs/docs/net_connector/4.1.6.1/images/connection_opened_successfully.png b/product_docs/docs/net_connector/4.1.6.1/images/connection_opened_successfully.png deleted file mode 100755 index bab12126d20..00000000000 --- a/product_docs/docs/net_connector/4.1.6.1/images/connection_opened_successfully.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:537e7edecce3882b794110e0ffc644a51cab69ba2c7e7f82a3e99d32c4b4ba65 -size 22683 diff --git a/product_docs/docs/net_connector/4.1.6.1/images/dialog.png b/product_docs/docs/net_connector/4.1.6.1/images/dialog.png deleted file mode 100755 index 19cba54d1f9..00000000000 --- a/product_docs/docs/net_connector/4.1.6.1/images/dialog.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:f922e6cd4e43927708b5f460f5389a5b3a41dd70f3a5394723e6aee7d710f1ae -size 9048 diff --git a/product_docs/docs/net_connector/4.1.6.1/images/dotnet_installation_complete.png b/product_docs/docs/net_connector/4.1.6.1/images/dotnet_installation_complete.png deleted file mode 100755 index 332ae795899..00000000000 --- a/product_docs/docs/net_connector/4.1.6.1/images/dotnet_installation_complete.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:0983f216ce071f57f7e758980c3f966caded4312412905a6aba66efa362fdb13 -size 272137 diff --git a/product_docs/docs/net_connector/4.1.6.1/images/dotnet_installation_dialog.png b/product_docs/docs/net_connector/4.1.6.1/images/dotnet_installation_dialog.png deleted file mode 100755 index b465d536032..00000000000 --- a/product_docs/docs/net_connector/4.1.6.1/images/dotnet_installation_dialog.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:994a725f061f1b51fd92ccc2df5abd9066a1cf4ea7600611ae57ebc6cc59af20 -size 51144 diff --git a/product_docs/docs/net_connector/4.1.6.1/images/dotnet_installation_wizard.png b/product_docs/docs/net_connector/4.1.6.1/images/dotnet_installation_wizard.png deleted file mode 100755 index 29c9a7f99f9..00000000000 --- a/product_docs/docs/net_connector/4.1.6.1/images/dotnet_installation_wizard.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:efe8029105db01662005a349a7b59c87b6f7dce3017990a197e3b9b681392860 -size 227235 diff --git a/product_docs/docs/net_connector/4.1.6.1/images/ready_to_install.png b/product_docs/docs/net_connector/4.1.6.1/images/ready_to_install.png deleted file mode 100755 index 59e44d96bc5..00000000000 --- a/product_docs/docs/net_connector/4.1.6.1/images/ready_to_install.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:91b18bef7b78a6dae7d6b664e2bccfbfdb4248dbd034cb59e2c6a35ada7da49c -size 44080 diff --git a/product_docs/docs/net_connector/4.1.6.1/images/selecting_the_connectors_installer.png b/product_docs/docs/net_connector/4.1.6.1/images/selecting_the_connectors_installer.png deleted file mode 100755 index 432e4473c09..00000000000 --- a/product_docs/docs/net_connector/4.1.6.1/images/selecting_the_connectors_installer.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:d939c7e6604025f82be47969d69e6acc63ab5a48a0af4341e42efe0156b42778 -size 97808 diff --git a/product_docs/docs/net_connector/4.1.6.1/images/starting_stackbuilder_plus.png b/product_docs/docs/net_connector/4.1.6.1/images/starting_stackbuilder_plus.png deleted file mode 100755 index 11665300652..00000000000 --- a/product_docs/docs/net_connector/4.1.6.1/images/starting_stackbuilder_plus.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:ce6bcefb865ca14239fb7e0e2ac5149ed56251cfbc5153869070d039f70857c6 -size 91989 diff --git a/product_docs/docs/net_connector/4.1.6.1/index.mdx b/product_docs/docs/net_connector/4.1.6.1/index.mdx deleted file mode 100644 index 7bebbabc516..00000000000 --- a/product_docs/docs/net_connector/4.1.6.1/index.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -title: "EDB .NET Connector" -directoryDefaults: - description: "EDB .NET Connector Version 4.1.6.1 Documentation and release notes." - -legacyRedirectsGenerated: - # This list is generated by a script. If you need add entries, use the `legacyRedirects` key. - - "/edb-docs/d/edb-postgres-net-connector/user-guides/net-guide/4.1.6.1/index.html" - - "/edb-docs/d/edb-postgres-net-connector/user-guides/net-guide/4.1.6.1/conclusion.html" - - "/edb-docs/d/edb-postgres-net-connector/user-guides/net-guide/4.1.6.1/genindex.html" - - "/edb-docs/d/edb-postgres-net-connector/user-guides/net-guide/4.1.6.1/whats_new.html" - - "/edb-docs/p/edb-postgres-net-connector/4.1.6.1" -pdf: true ---- - -The EDB .NET Connector distributed with EDB Postgres Advanced Server (Advanced Server) provides connectivity between a .NET client application and an Advanced Server database server. This guide provides installation instructions, usage instructions, and examples that demonstrate the functionality of the EDB .NET Connector: - -- How to connect to an instance of Advanced Server. -- How to retrieve information from an Advanced Server database. -- How to update information stored on an Advanced Server database. - -This document assumes that you have a solid working knowledge of both C# and .NET. The EDB .NET Connector functionality is built on the core functionality of the Npgsql open source project. The *Npgsql User's Manual* is available [online](http://www.npgsql.org/doc/index.html). - -
- -release_notes requirements_overview the_advanced_server_net_connector_overview installing_and_configuring_the_net_connector using_the_net_connector opening_a_database_connection retrieving_database_records parameterized_queries inserting_records_in_a_database deleting_records_in_a_database using_spl_stored_procedures_in_your_net_application using_advanced_queueing using_a_ref_cursor_in_a_net_application using_plugins using_object_types scram_compatibility advanced_server_net_connector_logging api_reference conclusion - -
diff --git a/product_docs/docs/net_connector/5.0.7.1/02_requirements_overview.mdx b/product_docs/docs/net_connector/5.0.7.1/02_requirements_overview.mdx deleted file mode 100644 index 7409d0b49be..00000000000 --- a/product_docs/docs/net_connector/5.0.7.1/02_requirements_overview.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -title: "Requirements overview" ---- - - - -These are the supported versions and platforms for the EDB .NET Connector. - -The EDB .NET Connector is certified with EDB Postgres Advanced Server version 10 and later. - -The EDB .NET Connector graphical installers are supported on the following Windows platforms: - -64-bit Windows: - -- Windows Server 2019 -- Windows Server 2016 -- Windows Server 2012 R2 -- Windows 10 -- Windows 8.1 - -32-bit Windows: - -- Windows 10 -- Windows 8.1 diff --git a/product_docs/docs/net_connector/5.0.7.1/03_the_advanced_server_net_connector_overview.mdx b/product_docs/docs/net_connector/5.0.7.1/03_the_advanced_server_net_connector_overview.mdx deleted file mode 100644 index 4f4c23da601..00000000000 --- a/product_docs/docs/net_connector/5.0.7.1/03_the_advanced_server_net_connector_overview.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -title: "The EDB .NET Connector overview" - ---- - - - -The EDB .NET Connector is a .NET data provider that allows a client application to connect to a database stored on an EDB Postgres Advanced Server host. The .NET Connector accesses the data directly, allowing the client application optimal performance, a broad spectrum of functionality, and access to EDB Postgres Advanced Server features. - -The .NET Connector supports the following frameworks: - -- .NET 5.0 -- .NET Core 3.1 -- .NET Standard 2.0 and 2.1 - - -## The .NET class hierarchy - -The .NET class hierarchy contains classes that you can use to create objects that control a connection to the EDB Postgres Advanced Server database and manipulate the data stored on the server. The following are just a few of the most commonly used object classes. - -`EDBConnection` - - The `EDBConnection` class represents a connection to EDB Postgres Advanced Server. An `EDBConnection` object contains a `ConnectionString` that instructs the .NET client how to connect to an EDB Postgres Advanced Server database. - -`EDBCommand` - - An `EDBCommand` object contains an SQL command that the client executes against EDB Postgres Advanced Server. Before you can execute an `EDBCommand` object, you must link it to an `EDBConnection` object. - -`EDBDataReader` - - An `EDBDataReader` object provides a way to read an EDB Postgres Advanced Server result set. You can use an `EDBDataReader` object to step through one row at a time, forward only. - -`EDBDataAdapter` - - An `EDBDataAdapter` object links a result set to the EDB Postgres Advanced Server database. You can modify values and use the `EDBDataAdapter` class to update the data stored in an EDB Postgres Advanced Server database. diff --git a/product_docs/docs/net_connector/5.0.7.1/04_installing_and_configuring_the_net_connector.mdx b/product_docs/docs/net_connector/5.0.7.1/04_installing_and_configuring_the_net_connector.mdx deleted file mode 100644 index 492bc7a14ef..00000000000 --- a/product_docs/docs/net_connector/5.0.7.1/04_installing_and_configuring_the_net_connector.mdx +++ /dev/null @@ -1,260 +0,0 @@ ---- -title: "Installing and configuring the .NET Connector" - ---- - - - -## Installing the .NET Connector - -You can use the EDB .NET Connector Installer (available [from the EDB website](https://www.enterprisedb.com/software-downloads-postgres)) to add the .NET Connector to your system. After downloading the installer, right-click on the installer icon, and select `Run As Administrator` from the context menu. When prompted, select an installation language and click `OK` to continue to the `Setup` window. - -![The .NET Connector Installation wizard](images/dotnet_installation_wizard.png) - -
The .NET Connector Installation wizard
- -Click `Next` to continue. - -![The Installation dialog](images/dotnet_installation_dialog.png) - -
The Installation dialog
- -Use the `Installation Directory` dialog to specify the directory in which the connector will be installed, and click `Next` to continue. - -![The Ready to Install dialog](images/ready_to_install.png) - -
The Ready to Install dialog
- -Click `Next` on the `Ready to Install` dialog to start the installation; popup dialogs confirm the progress of the installation wizard. - -![The installation is complete](images/dotnet_installation_complete.png) - -
The installation is complete
- -When the wizard informs you that it has completed the setup, click the `Finish` button to exit the dialog. - -You can also use StackBuilder Plus to add or update the connector on an existing Advanced Server installation; to open StackBuilder Plus, select `StackBuilder Plus` from the Windows `Apps` menu. - -![Starting StackBuilder Plus](images/starting_stackbuilder_plus.png) - -
Starting StackBuilder Plus
- -When StackBuilder Plus opens, follow the onscreen instructions. - -Select the `EnterpriseDB.Net Connector` option from the `Database Drivers` node of the tree control. - -![Selecting the Connectors installer](images/selecting_the_connectors_installer.png) - -
Selecting the Connectors installer
- -Follow the directions of the onscreen wizard to add or update an installation of an EDB Connector. - -## Configuring the .NET Connector - -Please see the following environment-specific sections for information about configuring the .NET Connector: - -- **Referencing the Library Files.** [General configuration information](#referencing_the_library_files) applicable to all components. -- **.NET 5.0** Instructions for configuring for use with [.NET 5.0](#setup_5_0). -- **.NET Core 3.1** Instructions for configuring for use with [.NET Core 3.1](#framework_setup_core3_1). -- **.NET Standard 2.0** Instructions for configuring for use with [.NET Standard 2.0](#standard_setup_2). -- **.NET Standard 2.1** Instructions for configuring for use with [.NET Standard 2.1](#standard_setup_2_1). -- **.NET EntityFramework Core** Instructions for configuring for use with [.NET EntityFramework Core](#entity_setup). - - - -### Referencing the library files - - - -To reference library files with Microsoft Visual Studio: - -1. Select the project in the `Solution Explorer`. -2. Select `Add Reference` from the `Project` menu. -3. When the `Add Reference` dialog box opens, browse to select the appropriate library files. - -Optionally, the library files can be copied to the specified location. - -Before you can use an EDB .NET class, you must import the namespace into your program. Importing a namespace makes the compiler aware of the classes available within the namespace. The namespace is: - - `EnterpriseDB.EDBClient` - -The method you use to include the namespace varies by the type of application you are writing. For example, the following command imports a namespace into an `ASP.NET` page: - - `<% import namespace="EnterpriseDB.EDBClient" %>` - -To import a namespace into a C# application, write: - - `using EnterpriseDB.EDBClient;` - -### .NET framework setup - -The following sections describe the setup for various .NET versions. - - - -#### .NET 5.0 - -For .NET 5.0, the data provider installation path is: - - `C:\Program Files\edb\dotnet\net5.0\` - -You must add the following dependencies to your project: - - `EnterpriseDB.EDBClient.dll` - -Depending upon the type of application you use, you may be required to import the namespace into the source code. See [Referencing the Library Files](#referencing_the_library_files) for this and other information about referencing library files. - - - -#### .NET Core 3.1 - -If you are using .NET Core 3.1, the data provider installation path is: - - `C:\Program Files\edb\dotnet\netcoreapp3.1\` - -The following shared library files are required: - - `EnterpriseDB.EDBClient.dll` - - `System.Threading.Tasks.Extensions.dll` - - `System.Runtime.CompilerServices.Unsafe.dll` - - `System.ValueTuple.dll` - - `System.Memory.dll` - -Depending upon the type of application you use, you may be required to import the namespace into the source code. See [Referencing the Library Files](#referencing_the_library_files) for this and other information about referencing library files. - - - - -#### .NET Standard 2.0 - -For .NET Standard Framework 2.0, the data provider installation path is: - - `C:\Program Files\edb\dotnet\netstandard2.0\` - -You must add the following dependencies to your project: - - `EnterpriseDB.EDBClient.dll` - - `System.Threading.Tasks.Extensions.dll` - - `System.Runtime.CompilerServices.Unsafe.dll` - - `System.ValueTuple.dll` - -!!! Note - If your target framework is .Net Core 2.0, then include the following file in your project: - -`System.Threading.Tasks.Extensions.dll` - -Depending upon the type of application you use, you may be required to import the namespace into the source code. See [Referencing the Library Files](#referencing_the_library_files) for this and other information about referencing library files. - - - -#### .NET Standard 2.1 - -For .NET Standard Framework 2.1, the data provider installation path is: - - `C:\Program Files\edb\dotnet\netstandard2.1\` - -The following shared library files are required: - - `EnterpriseDB.EDBClient.dll` - - `System.Memory.dll` - - `System.Runtime.CompilerServices.Unsafe.dll` - - `System.Text.Json.dll` - - `System.Threading.Tasks.Extensions.dll` - - `System.ValueTuple.dll` - -Depending upon the type of application you use, you may be required to import the namespace into the source code. See [Referencing the Library Files](#referencing_the_library_files) for this and other information about referencing library files. - - - -#### .NET EntityFramework Core - -To configure the .NET Connector for use with Entity Framework Core, the data provider installation path is: - - `C:\Program Files\edb\dotnet\EFCore` - -The following shared library file is required: - - `EnterpriseDB.EDBClient.EntityFrameworkCore.PostgreSQL.dll` - -!!! Note - - Entity Framework Core can be used with the EnterpriseDB.EDBClient.dll library available in the net5.0 and netcoreapp3.1 subdirectories. - -See [Referencing the Library Files](#referencing_the_library_files) for information about referencing library files. - -The following NuGet packages are required: - - `Microsoft.EntityFrameworkCore.Design` - - `Microsoft.EntityFrameworkCore.Relational` - - `Microsoft.EntityFrameworkCore.Abstractions` - -In case of NetCoreApp3.1 you have to add the following NuGet package in addition to the above packages: - - `System.Text.Json` - -For usage information about Entity Framework Core, refer to the Microsoft documentation. - -**Prerequisite**: - -Install dotnet-ef (using Command Prompt) - - `dotnet tool install --global dotnet-ef` - -**Sample project** - -Create a new Console Application based on .NET 5.0 or NetCoreApp3.1 - -Add Reference to the following EDB assemblies: - - `EnterpriseDB.EDBClient.EntityFrameworkCore.PostgreSQL.dll` - - `EnterpriseDB.EDBClient.dll` - -Add the following NuGet packages: - - `Microsoft.EntityFrameworkCore.Design` - - `Microsoft.EntityFrameworkCore.Relational` - - `Microsoft.EntityFrameworkCore.Abstractions` - -In case of NetCoreApp3.1 add the following NuGet package in addition to the above packages: - - `System.Text.Json` - -Command Prompt - - `Open Tools` → `Command Line` → `Developer Command Prompt` - -**Database first scenario** - -Issue the following command to create Model Classes corresponding to all objects in the specified database: - -`dotnet ef dbcontext scaffold Host=;Database=;Username=;Password=;Port= EnterpriseDB.EDBClient.EntityFrameworkCore.PostgreSQL -o Models` - -**Code first scenario** - -Add code for defining a DbContext and create, read, update & delete operations. - -Please refer to the Microsoft documentation for further details. - -Issue the following commands to create the initial database and tables: - - `dotnet ef migrations add InitialCreate --context BloggingContext` - - `dotnet ef database update --context BloggingContext` - diff --git a/product_docs/docs/net_connector/5.0.7.1/05_using_the_net_connector.mdx b/product_docs/docs/net_connector/5.0.7.1/05_using_the_net_connector.mdx deleted file mode 100644 index dcdac30a376..00000000000 --- a/product_docs/docs/net_connector/5.0.7.1/05_using_the_net_connector.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -title: "Using the .NET Connector" - ---- - - - -These examples show how you can use the EDB object classes that are provided by the EDB .NET Connector that allow a .NET application to connect to and interact with an EDB Postgres Advanced Server database. - -To use these examples, place the .NET library files in the same directory as the compiled form of your application. All of these examples are written in C#, and each is embedded in an ASP.NET page. The same logic and code applies to other .NET applications (WinForm or console applications, for example). - -Create and save the following `web.config` file in the same directory as the sample code. The examples make use of the `DB_CONN_STRING` key from this configuration file to return a connection string from the EDB Postgres Advanced Server host. - -```text - - - - - - -``` - -An EDB Postgres Advanced Server connection string for an ASP.NET web application is stored in the `web.config` file. If you're writing an application that doesn't use ASP.NET, provide the connection information in an application configuration file such as `app.config`. diff --git a/product_docs/docs/net_connector/5.0.7.1/06_opening_a_database_connection.mdx b/product_docs/docs/net_connector/5.0.7.1/06_opening_a_database_connection.mdx deleted file mode 100644 index a8baf0abb11..00000000000 --- a/product_docs/docs/net_connector/5.0.7.1/06_opening_a_database_connection.mdx +++ /dev/null @@ -1,275 +0,0 @@ ---- -title: "Opening a database connection" - ---- - - - -An `EDBConnection` object is responsible for handling the communication between an instance of EDB Postgres Advanced Server and a .NET application. Before you can access data stored in an EDB Postgres Advanced Server database, you must create and open an `EDBConnection` object. - -The examples that follow show the basic steps for connecting to an instance of Advanced Server. You must: - -1. Import the namespace `EnterpriseDB.EDBClient`. -2. Create an instance of `EDBConnection`. -3. Initialize the `EDBConnection` object by passing a connection string as a parameter to the constructor for the `EDBConnection` class. -4. Call the `Open` method of the `EDBConnection` object to open the connection. - - - -## Connection string parameters - -A valid connection string specifies location and authentication information for an EDB Postgres Advanced Server instance. You must provide the connection string before opening the connection. A connection string must contain: - -- The name or IP address of the server -- The name of the EDB Postgres Advanced Server database -- The name of an EDB Postgres Advanced Server user -- The password associated with that user - -You can include the following parameters in the connection string: - -`CommandTimeout` - - `CommandTimeout` specifies the length of time (in seconds) to wait for a command to finish executing before throwing an exception. The default value is `20`. - -`ConnectionLifeTime` - - Use `ConnectionLifeTime` to specify the length of time (in seconds) to wait before closing unused connections in the pool. The default value is `15`. - -`Database` - - Use the `Database` parameter to specify the name of the database for the application to connect to. The default is the name of the connecting user. - -`Encoding` - - The `Encoding` parameter is obsolete. The parameter always returns the string `unicode` and silently ignores attempts to set it. - -`Integrated Security` - - Specify a value of `true` to use Windows Integrated Security. By default, `Integrated Security` is set to `false`, and Windows Integrated Security is disabled. - -`Load Role Based Tables` - - Use `Load Role Based Tables` to load table OIDs based on role. This change impacts only the loading of table type OID and not the composite type. Setting this parameter to `true` triggers the new functionality. The default value is `false`. - -`MaxPoolSize` - - `MaxPoolSize` instructs `EDBConnection` to dispose of pooled connections when the pool exceeds the specified number of connections. The default value is `20`. - -`MinPoolSize` - - `MinPoolSize` instructs `EDBConnection` to preallocate the specified number of connections with the server. The default value is `1`. - -`Password` - - When using clear text authentication, specify the password to use to establish a connection with the server. - -`Pooling` - - Specify a value of `false` to disable connection pooling. By default, `Pooling` is set to `true` to enable connection pooling. - -`Port` - - The `Port` parameter specifies the port for the application to connect to. - -`Protocol` - - The specific protocol version to use (instead of automatic). Specify an integer value of `2` or `3`. - -`SearchPath` - - Use the `SearchPath` parameter to change the search path to named and public schemas. - -`Server` - - The name or IP address of the EDB Postgres Advanced Server host. - -`SSL` - - Specify a value of `true` to attempt a secure connection. By default, `SSL` is set to `false`. - -`sslmode` - - Use `sslmode` to specify an SSL connection control preference. `sslmode` can be: - - `prefer` — Use SSL if possible. - - `require` — Throw an exception if an SSL connection can't be established. - - `allow` — Connect without SSL. This parameter isn't supported. - - `disable` — Don't attempt an SSL connection. This is the default behavior. - -`SyncNotification` - - Use the `SyncNotification` parameter to specify for `EDBDataprovider` to use synchronous notifications. The default value is `false`. - -`Timeout` - - `Timeout` specifies the length of time (in seconds) to wait for an open connection. The default value is `15`. - -`User Id` - - The `User Id` parameter specifies the user name to use for the connection. - -## Example: Opening a database connection using ASP.NET - -This example shows how to open a connection to an instance of EDB Postgres Advanced Server and then close the connection. The connection is established using the credentials specified in the `DB_CONN_STRING` configuration parameter. See [Using the .Net Connector](05_using_the_net_connector/#using_the_net_connector) for an introduction to connection information. Also see [Connection string parameters](#connection-string-parameters) for connection parameters. - -```Text -<% @ Page Language="C#" %> -<% @Import Namespace="EnterpriseDB.EDBClient" %> -<% @Import Namespace="System.Configuration" %> - - -``` - -If the connection is successful, a message appears indicating that the connection opened successfully. - -## Example: Opening a database connection from a console application - -This example opens a connection with an EDB Postgres Advanced Server database using a console-based application. - -Before writing the code for the console application, create an `app.config` file that stores the connection string to the database. Using a configuration file makes it convenient to update the connection string if the information changes. - -```Text - - - - - - -``` - -Enter the following code sample into a file: - -```Text -using System; -using System.Data; -using EnterpriseDB.EDBClient; -using System.Configuration; - -namespace EnterpriseDB -{ - - class EDB - { - - static void Main(string[] args) - { - string strConnectionString = ConfigurationManager.AppSettings - ["DB_CONN_STRING"]; - - EDBConnection conn = new EDBConnection(strConnectionString); - - try - { - conn.Open(); - Console.WriteLine("Connection Opened Successfully"); - } - - catch(Exception exp) - { - throw new Exception(exp.ToString()); - } - - finally - { - conn.Close(); - } - } - } -} -``` - -Save the file as `EDBConnection-Sample.cs` and compile it with the following command: - -`csc /r:EnterpriseDB.EDBClient.dll /out:Console.exe EDBConnection-Sample.cs` - -Compiling the sample generates a `Console.exe` file. You can execute the sample code by entering `Console.exe`. When executed, the console verifies that it opened successfully. - -## Example: Opening a database connection from a Windows form application - -This example opens a database connection using a .NET WinForm application. To use the example, save the following code as `WinForm-Example.cs` in a directory that contains the library files. - -```Text -using System; -using System.Windows.Forms; -using System.Drawing; -using EnterpriseDB.EDBClient; - -namespace EDBTestClient -{ - - class Win_Conn - { - static void Main(string[] args) - { - Form frmMain = new Form(); - Button btnConn = new Button(); - btnConn.Location = new System.Drawing.Point(104, 64); - btnConn.Name = "btnConn"; - btnConn.Text = "Open Connection"; - btnConn.Click += new System.EventHandler(btnConn_Click); - - frmMain.Controls.Add(btnConn); - frmMain.Text = "EnterpriseDB"; - - Application.Run(frmMain); - } - - private static void btnConn_Click(object sender, System.EventArgs e) - { - EDBConnection conn = null; - try - { - string connectionString = "Server=10.90.1.29;port=5444; - username=edb;password=edb;database=edb"; - conn = new EDBConnection(connectionString); - conn.Open(); - MessageBox.Show("Connection Open"); - } - catch(EDBException exp) - { - MessageBox.Show(exp.ToString()); - } - finally - { - conn.Close(); - } - } - } -} -``` - -Change the database connection string to point to the database that you want to connect to. Then compile the file with the following command: - -`csc /r:EnterpriseDB.EDBClient.dll /out:WinForm.exe WinForm-Example.cs` - -This command generates a `WinForm.exe` file in the same folder that the executable was compiled under. Invoking the executable displays a message that the connection was successful. diff --git a/product_docs/docs/net_connector/5.0.7.1/07_retrieving_database_records.mdx b/product_docs/docs/net_connector/5.0.7.1/07_retrieving_database_records.mdx deleted file mode 100644 index 08e0db54530..00000000000 --- a/product_docs/docs/net_connector/5.0.7.1/07_retrieving_database_records.mdx +++ /dev/null @@ -1,120 +0,0 @@ ---- -title: "Retrieving database records" - ---- - - - -You can use a `SELECT` statement to retrieve records from the database using a `SELECT` command. To execute a `SELECT` statement you must: - -- Create and open a database connection. -- Create an `EDBCommand` object that represents the `SELECT` statement. -- Execute the command with the `ExecuteReader()` method of the `EDBCommand` object returning `EDBDataReader`. -- Loop through the `EDBDataReader`, displaying the results or binding the `EDBDataReader` to some control. - -An `EDBDataReader` object represents a forward-only and read-only stream of database records, presented one record at a time. To view a subsequent record in the stream, you must call the `Read()` method of the `EDBDataReader` object. - -The example that follows: - -1. Imports the EDB Postgres Advanced Server namespace `EnterpriseDB.EDBClient`. -2. Initializes an `EDBCommand` object with a `SELECT` statement. -3. Opens a connection to the database. -4. Executes the `EDBCommand` by calling the `ExecuteReader` method of the `EDBCommand` object. - -The results of the SQL statement are retrieved into an `EDBDataReader` object. - -Loop through the contents of the `EDBDataReader` object to display the records returned by the query in a `WHILE` loop. - -The `Read()` method advances to the next record (if a record exists) and returns `true` if a record exists. It returns `false` if `EDBDataReader` has reached the end of the result set. - -```Text -<% @ Page Language="C#" %> -<% @Import Namespace="EnterpriseDB.EDBClient" %> -<% @Import Namespace="System.Data" %> -<% @Import Namespace="System.Configuration" %> - - -``` - -To exercise the sample code, save the code in your default web root directory in a file named `selectEmployees.aspx`. Then, to invoke the program, enter the following URL into a browser: `http://localhost/selectEmployees.aspx`. - -## Retrieving a single database record - -To retrieve a single result from a query, use the `ExecuteScalar()` method of the `EDBCommand` object. The `ExecuteScalar()` method returns the first value of the first column of the first row of the `DataSet` generated by the specified query. - -```text -<% @ Page Language="C#" %> -<% @Import Namespace="EnterpriseDB.EDBClient" %> -<% @Import Namespace="System.Data" %> -<% @Import Namespace="System.Configuration" %> - - -``` - -Save the sample code in a file named `selectscalar.aspx` in a web root directory. - -To invoke the sample code, enter the following in a browser: `http://localhost/selectScalar.aspx` - -The sample includes an explicit conversion of the value returned by the `ExecuteScalar()` method. The `ExecuteScalar()` method returns an object. To view the object, you must convert it to an integer value by using the `Convert.ToInt32` method. diff --git a/product_docs/docs/net_connector/5.0.7.1/08_parameterized_queries.mdx b/product_docs/docs/net_connector/5.0.7.1/08_parameterized_queries.mdx deleted file mode 100644 index a6a3db44020..00000000000 --- a/product_docs/docs/net_connector/5.0.7.1/08_parameterized_queries.mdx +++ /dev/null @@ -1,59 +0,0 @@ ---- -title: "Parameterized queries" - ---- - - - -A _parameterized query_ is a query with one or more parameter markers embedded in the SQL statement. Before executing a parameterized query, you must supply a value for each marker found in the text of the SQL statement. - -Parameterized queries are useful when you don't know the complete text of a query when you write your code. For example, the value referenced in a `WHERE` clause can be calculated from user input. - -As shown in the following example, you must declare the data type of each parameter specified in the parameterized query by creating an `EDBParameter` object and adding that object to the command's parameter collection. Then, you must specify a value for each parameter by calling the parameter's `Value()` function. - -The example shows using a parameterized query with an `UPDATE` statement that increases an employee salary: - -```text -<% @ Page Language="C#" Debug="true"%> -<% @Import Namespace="EnterpriseDB.EDBClient" %> -<% @Import Namespace="System.Data" %> -<% @Import Namespace="System.Configuration" %> - - -``` - -Save the sample code in a file named `updateSalary.aspx` in a web root directory. - -To invoke the sample code, enter the following in a browser: `http://localhost/updateSalary.aspx` diff --git a/product_docs/docs/net_connector/5.0.7.1/09_inserting_records_in_a_database.mdx b/product_docs/docs/net_connector/5.0.7.1/09_inserting_records_in_a_database.mdx deleted file mode 100644 index a08fcf70866..00000000000 --- a/product_docs/docs/net_connector/5.0.7.1/09_inserting_records_in_a_database.mdx +++ /dev/null @@ -1,64 +0,0 @@ ---- -title: "Inserting records in a database" - ---- - - - -You can use the `ExecuteNonQuery()` method of `EDBCommand` to add records to a database stored on an EDB Postgres Advanced Server host with an `INSERT` command. - -In the example that follows, the `INSERT` command is stored in the variable `cmd`. The values prefixed with a colon (`:`) are placeholders for `EDBParameters` that are instantiated, assigned values, and then added to the `INSERT` command's parameter collection in the statements that follow. The `INSERT` command is executed by the `ExecuteNonQuery()` method of the `cmdInsert` object. - -The example adds an employee to the `emp` table: - -```Text -<% @ Page Language="C#" Debug="true"%> -<% @Import Namespace="EnterpriseDB.EDBClient" %> -<% @Import Namespace="System.Data" %> -<% @Import Namespace="System.Configuration" %> - - -``` - -Save the sample code in a file named `insertEmployee.aspx` in a web root directory. - -To invoke the sample code, enter the following in a browser: `http://localhost/insertEmployee.aspx` diff --git a/product_docs/docs/net_connector/5.0.7.1/10_deleting_records_in_a_database.mdx b/product_docs/docs/net_connector/5.0.7.1/10_deleting_records_in_a_database.mdx deleted file mode 100644 index ac5545aeb44..00000000000 --- a/product_docs/docs/net_connector/5.0.7.1/10_deleting_records_in_a_database.mdx +++ /dev/null @@ -1,65 +0,0 @@ ---- -title: "Deleting records in a database" - ---- - - - -You can use the `ExecuteNonQuery()` method of `EDBCommand` to delete records from a database stored on an EDB Postgres Advanced Server host with a `DELETE` statement. - -In the example that follows, the `DELETE` command is stored in the variable `strDeleteQuery`. The code passes the employee number to the `DELETE` command (specified by `EmpNo`). The command is then executed using the `ExecuteNonQuery()` method. - -```text -<% @ Page Language="C#" Debug="true"%> -<% @Import Namespace="EnterpriseDB.EDBClient" %> -<% @Import Namespace="System.Data" %> -<% @Import Namespace="System.Configuration" %> - - -``` - -Save the sample code in a file named `deleteEmployee.aspx` in a web root directory. - -To invoke the sample code, enter the following in a browser: `http://localhost/deleteEmployee.aspx` diff --git a/product_docs/docs/net_connector/5.0.7.1/11_using_spl_stored_procedures_in_your_net_application.mdx b/product_docs/docs/net_connector/5.0.7.1/11_using_spl_stored_procedures_in_your_net_application.mdx deleted file mode 100644 index 3950edbe6b6..00000000000 --- a/product_docs/docs/net_connector/5.0.7.1/11_using_spl_stored_procedures_in_your_net_application.mdx +++ /dev/null @@ -1,409 +0,0 @@ ---- -title: "Using SPL stored procedures in your .NET application" - ---- - - - -You can include SQL statements in an application in two ways: - -- By adding the SQL statements directly in the .NET application code. -- By packaging the SQL statements in a stored procedure and executing the stored procedure from the .NET application. - -In some cases, a stored procedure can provide advantages over embedded SQL statements. Stored procedures support complex conditional and looping constructs that are difficult to duplicate with SQL statements embedded directly in an application. - -You can also see an improvement in performance by using stored procedures. A stored procedure needs to be parsed, compiled, and optimized only once on the server side. A SQL statement that's included in an application might be parsed, compiled, and optimized each time it's executed from a .NET application. - -To use a stored procedure in your .NET application you must: - -1. Create an SPL stored procedure on the EDB Postgres Advanced Server host. -2. Import the `EnterpriseDB.EDBClient` namespace. -3. Pass the name of the stored procedure to the instance of the `EDBCommand`. -4. Change the `EDBCommand.CommandType` to `CommandType.StoredProcedure`. -5. `Prepare()` the command. -6. Execute the command. - -## Example: Executing a stored procedure without parameters - -This sample procedure prints the name of department 10. The procedure takes no parameters and returns no parameters. To create the sample procedure, invoke EDB-PSQL and connect to the EDB Postgres Advanced Server host database. Enter the following SPL code at the command line: - -```Text -CREATE OR REPLACE PROCEDURE list_dept10 -IS - v_deptname VARCHAR2(30); -BEGIN - DBMS_OUTPUT.PUT_LINE('Dept No: 10'); - SELECT dname INTO v_deptname FROM dept WHERE deptno = 10; - DBMS_OUTPUT.PUT_LINE('Dept Name: ' || v_deptname); -END; -``` - -When EDB Postgres Advanced Server has validated the stored procedure, it echoes `CREATE PROCEDURE`. - -### Using the EDBCommand object to execute a stored procedure - -The `CommandType` property of the `EDBCommand` object indicates the type of command being executed. The `CommandType` property is set to one of three possible `CommandType` enumeration values: - -- Use the default `Text` value when passing a SQL string for execution. -- Use the `StoredProcedure` value, passing the name of a stored procedure for execution. -- Use the `TableDirect` value when passing a table name. This value passes back all records in the specified table. - -The `CommandText` property must contain a SQL string, stored procedure name, or table name, depending on the value of the `CommandType` property. - -The following example executes the stored procedure: - -```Text -<% @ Page Language="C#" Debug="true"%> -<% @Import Namespace="EnterpriseDB.EDBClient" %> -<% @Import Namespace="System.Data" %> -<% @Import Namespace="System.Configuration" %> - - -``` - -Save the sample code in a file named `storedProc.aspx` in a web root directory. - -To invoke the sample code, enter the following in a browser: `http://localhost/storedProc.aspx` - -## Example: Executing a stored procedure with IN parameters - -The following example shows calling a stored procedure that includes `IN` parameters. To create the sample procedure, invoke `EDB-PSQL` and connect to the EDB Postgres Advanced Server host database. Enter the following SPL code at the command line: - -```Text -CREATE OR REPLACE PROCEDURE - EMP_INSERT - ( - pENAME IN VARCHAR, - pJOB IN VARCHAR, - pSAL IN FLOAT4, - pCOMM IN FLOAT4, - pDEPTNO IN INTEGER, - pMgr IN INTEGER - ) -AS -DECLARE - CURSOR TESTCUR IS SELECT MAX(EMPNO) FROM EMP; - MAX_EMPNO INTEGER := 10; -BEGIN - - OPEN TESTCUR; - FETCH TESTCUR INTO MAX_EMPNO; - INSERT INTO EMP(EMPNO,ENAME,JOB,SAL,COMM,DEPTNO,MGR) - VALUES(MAX_EMPNO+1,pENAME,pJOB,pSAL,pCOMM,pDEPTNO,pMgr); - CLOSE testcur; -END; -``` - -When EDB Postgres Advanced Server has validated the stored procedure, it echoes `CREATE PROCEDURE`. - -### Passing input values to a stored procedure - -Calling a stored procedure that contains parameters is similar to executing a stored procedure without parameters. The major difference is that, when calling a parameterized stored procedure, you must use the `EDBParameter` collection of the `EDBCommand` object. When the `EDBParameter` is added to the `EDBCommand` collection, properties such as `ParameterName`, `DbType`, `Direction`, `Size`, and `Value` are set. - -The following example shows the process of executing a parameterized stored procedure from a C# script. - -```Text -<% @ Page Language="C#" Debug="true"%> -<% @Import Namespace="EnterpriseDB.EDBClient" %> -<% @Import Namespace="System.Data" %> -<% @Import Namespace="System.Configuration" %> - - - - -``` - -Save the sample code in a file named `storedProcInParam.aspx` in a web root directory. - -To invoke the sample code, enter the following in a browser: `http://localhost/storedProcInParam.aspx` - -In the example, the body of the `Page_Load` method declares and instantiates an `EDBConnection` object. The sample then creates an `EDBCommand` object with the properties needed to execute the stored procedure. - -The example then uses the `Add` method of the `EDBCommand Parameter` collection to add six input parameters. - -```text -EDBCommand cmdStoredProc = new EDBCommand -("emp_insert(:EmpName,:Job,:Salary,:Commission,:DeptNo,:Manager)",conn); -cmdStoredProc.CommandType = CommandType.StoredProcedure; -``` - -It assigns a value to each parameter before passing them to the `EMP_INSERT` stored procedure. - -The `Prepare()` method prepares the statement before calling the `ExecuteNonQuery()` method. - -The `ExecuteNonQuery` method of the `EDBCommand` object executes the stored procedure. After the stored procedure executes, a test record is inserted into the `emp` table, and the values inserted are displayed on the webpage. - -## Example: Executing a stored procedure with IN, OUT, and INOUT parameters - -The previous example demonstrated how to pass `IN` parameters to a stored procedure. The following examples show how to pass `IN` values and return `OUT` values from a stored procedure. - -### Creating the stored procedure - -The following stored procedure passes the department number and returns the corresponding location and department name. To create the sample procedure, open the EDB-PSQL command line, and connect to the EDB Postgres Advanced Server host database. Enter the following SPL code at the command line: - -```Text -CREATE OR REPLACE PROCEDURE - DEPT_SELECT - ( - pDEPTNO IN INTEGER, - pDNAME OUT VARCHAR, - pLOC OUT VARCHAR - ) -AS -DECLARE - CURSOR TESTCUR IS SELECT DNAME,LOC FROM DEPT; - REC RECORD; -BEGIN - - OPEN TESTCUR; - FETCH TESTCUR INTO REC; - - pDNAME := REC.DNAME; - pLOC := REC.LOC; - - CLOSE testcur; -END; -``` - -When EDB Postgres Advanced Server has validated the stored procedure, it echoes `CREATE PROCEDURE`. - -### Receiving output values from a stored procedure - -When retrieving values from `OUT` parameters, you must explicitly specify the direction of those parameters as `Output`. You can retrieve the values from `Output` parameters in two ways: - -- Call the `ExecuteReader` method of the `EDBCommand` and explicitly loop through the returned `EDBDataReader`, searching for the values of `OUT` parameters. -- Call the `ExecuteNonQuery` method of `EDBCommand` and explicitly get the value of a declared `Output` parameter by calling that `EDBParameter` value property. - -In each method, you must declare each parameter, indicating the direction of the parameter (`ParameterDirection.Input`, `ParameterDirection.Output`, or `ParameterDirection.InputOutput`). Before invoking the procedure, you must provide a value for each `IN` and `INOUT` parameter. After the procedure returns, you can retrieve the `OUT` and `INOUT` parameter values from the `command.Parameters[]` array. - -The following code shows using the `ExecuteReader` method to retrieve a result set: - -```Text -<% @ Page Language="C#" Debug="true"%> -<% @Import Namespace="EnterpriseDB.EDBClient" %> -<% @Import Namespace="System.Data" %> -<% @Import Namespace="System.Configuration" %> - - -``` - -The following code shows using the `ExecuteNonQuery` method to retrieve a result set: - -```Text -<% @ Page Language="C#" Debug="true"%> -<% @Import Namespace="EnterpriseDB.EDBClient" %> -<% @Import Namespace="System.Data" %> -<% @Import Namespace="System.Configuration" %> - - -``` diff --git a/product_docs/docs/net_connector/5.0.7.1/12_using_advanced_queueing.mdx b/product_docs/docs/net_connector/5.0.7.1/12_using_advanced_queueing.mdx deleted file mode 100644 index b234b682435..00000000000 --- a/product_docs/docs/net_connector/5.0.7.1/12_using_advanced_queueing.mdx +++ /dev/null @@ -1,490 +0,0 @@ ---- -title: "Using advanced queueing" - ---- - - - -EDB Postgres Advanced Server advanced queueing provides message queueing and message processing for the EDB Postgres Advanced Server database. User-defined messages are stored in a queue. A collection of queues is stored in a queue table. Create a queue table before creating a queue that depends on it. - -On the server side, procedures in the `DBMS_AQADM` package create and manage message queues and queue tables. Use the `DBMS_AQ` package to add or remove messages from a queue or register or unregister a PL/SQL callback procedure. For more information about `DBMS_AQ` and `DBMS_AQADM`, see [DBMS_AQ](/epas/latest/reference/oracle_compatibility_reference/epas_compat_bip_guide/03_built-in_packages/02_dbms_aq/). - -On the client side, the application uses the EDB.NET driver to enqueue and dequeue messages. - -## Enqueueing or dequeueing a message - -For more information about using EDB Postgres Advanced Server's advanced queueing functionality, see the [Database Compatibility for Oracle Developers Built-in Package Guide](/epas/latest/reference/oracle_compatibility_reference/epas_compat_bip_guide/). - -### Server-side setup - -To use advanced queueing functionality on your .NET application, you must first create a user-defined type, queue table, and queue, and then start the queue on the database server. Invoke EDB-PSQL and connect to the EDB Postgres Advanced Server host database. Use the following SPL commands at the command line: - -**Creating a user-defined type** - -To specify a RAW data type, create a user-defined type. The following example shows creating a user-defined type named as `myxml`. - -`CREATE TYPE myxml AS (value XML)`; - -**Creating the queue table** - -A queue table can hold multiple queues with the same payload type. The following example shows creating a table named `MSG_QUEUE_TABLE`. - -```Text -EXEC DBMS_AQADM.CREATE_QUEUE_TABLE - (queue_table => 'MSG_QUEUE_TABLE', - queue_payload_type => 'myxml', - comment => 'Message queue table'); -END; -``` - -**Creating the queue** - -The following example shows creating a queue named `MSG_QUEUE` in the table `MSG_QUEUE_TABLE`. - -```Text -BEGIN -DBMS_AQADM.CREATE_QUEUE ( queue_name => 'MSG_QUEUE', queue_table => 'MSG_QUEUE_TABLE', comment => 'This queue contains pending messages.'); -END; -``` - -**Starting the queue** - -Once the queue is created, invoke the following SPL code at the command line to start a queue in the EDB database. - -```Text -BEGIN -DBMS_AQADM.START_QUEUE -(queue_name => 'MSG_QUEUE'); -END; -``` - -### Client-side example - -Once you've created a user-defined type, followed by queue table and queue, start the queue. Then, you can enqueue or dequeue a message using EDB .Net drivers. - -**Enqueue a message** - -To enqueue a message on your .NET application, you must: - -1. Import the `EnterpriseDB.EDBClient` namespace. -2. Pass the name of the queue and create the instance of the `EDBAQQueue`. -3. Create the enqueue message and define a payload. -4. Call the `queue.Enqueue` method. - -The following code shows using the `queue.Enqueue` method: - -!!! Note - The following code creates the message and serializes it. This is just an example code and won't compile if copied as it is. You must serialize the message as XML. - -```Text -using EnterpriseDB.EDBClient; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace AQXml -{ - class MyXML - { - public string value { get; set; } - } - class Program - { - static void Main(string[] args) - { - int messagesToSend = 1; - if (args.Length > 0 && !string.IsNullOrEmpty(args[0])) - { - messagesToSend = int.Parse(args[0]); - } - for (int i = 0; i < 5; i++) - { - EnqueMsg("test message: " + i); - } - } - - private static EDBConnection GetConnection() - { - string connectionString = "Server=127.0.0.1;Host=127.0.0.1;Port=5444;User Id=enterprisedb;Password=test;Database=edb;Timeout=999"; - EDBConnection connection = new EDBConnection(connectionString); - connection.Open(); - return connection; - } - - - private static string ByteArrayToString(byte[] byteArray) - { - // Sanity check if it's null so we don't incur overhead of an exception - if (byteArray == null) - { - return string.Empty; - } - try - { - StringBuilder hex = new StringBuilder(byteArray.Length * 2); - foreach (byte b in byteArray) - { - hex.AppendFormat("{0:x2}", b); - } - - return hex.ToString().ToUpper(); - } - catch - { - return string.Empty; - } - } - - private static bool EnqueMsg(string msg) - { - EDBConnection con = GetConnection(); - using (EDBAQQueue queue = new EDBAQQueue("MSG_QUEUE", con)) - { - queue.MessageType = EDBAQMessageType.Xml; - EDBTransaction txn = queue.Connection.BeginTransaction(); - QueuedEntities.Message queuedMessage = new QueuedEntities.Message() { MessageText = msg }; - - try - { - string rootElementName = queuedMessage.GetType().Name; - if (rootElementName.IndexOf(".") != -1) - { - rootElementName = rootElementName.Split('.').Last(); - } - - string xml = new Utils.XmlFragmentSerializer().Serialize(queuedMessage); - EDBAQMessage queMsg = new EDBAQMessage(); - queMsg.Payload = new MyXML { value = xml }; - queue.MessageType = EDBAQMessageType.Udt; - queue.UdtTypeName = "myxml"; - EDBConnection.GlobalTypeMapper.MapComposite("myxml"); - con.ReloadTypes(); - queue.Enqueue(queMsg); - var messageId = ByteArrayToString((byte[])queMsg.MessageId); - Console.WriteLine("MessageID: " + messageId); - txn.Commit(); - queMsg = null; - xml = null; - rootElementName = null; - return true; - } - catch (Exception ex) - { - txn?.Rollback(); - Console.WriteLine("Failed to enqueue message."); - Console.WriteLine(ex.ToString()); - return false; - } - finally - { - queue?.Connection?.Dispose(); - } - } - } - - } -} -``` - -**Dequeueing a message** - -To dequeue a message on your .NET application, you must: - -1. Import the `EnterpriseDB.EDBClient` namespace. -2. Pass the name of the queue and create the instance of the `EDBAQQueue`. -3. Call the `queue.Dequeue` method. - -!!! Note - The following code creates the message and serializes it. This is just an example code and won't compile if copied as it is. You must serialize the message as XML. - -```Text -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using EnterpriseDB.EDBClient; - -namespace DequeueXML -{ - class MyXML - { - public string value { get; set; } - } - class Program - { - static void Main(string[] args) - { - DequeMsg(); - } - - - private static EDBConnection GetConnection() - { - string connectionString = "Server=127.0.0.1;Host=127.0.0.1;Port=5444;User Id=enterprisedb;Password=test;Database=edb;Timeout=999"; - EDBConnection connection = new EDBConnection(connectionString); - connection.Open(); - return connection; - } - - - private static string ByteArrayToString(byte[] byteArray) - { - // Sanity check if it's null so we don't incur overhead of an exception - if (byteArray == null) - { - return string.Empty; - } - try - { - StringBuilder hex = new StringBuilder(byteArray.Length * 2); - foreach (byte b in byteArray) - { - hex.AppendFormat("{0:x2}", b); - } - - return hex.ToString().ToUpper(); - } - catch - { - return string.Empty; - } - } - public static void DequeMsg(int waitTime = 10) - { - EDBConnection con = GetConnection(); - using (EDBAQQueue queueListen = new EDBAQQueue("MSG_QUEUE", con)) - { - queueListen.UdtTypeName = "myxml"; - queueListen.DequeueOptions.Navigation = EDBAQNavigationMode.FIRST_MESSAGE; - queueListen.DequeueOptions.Visibility = EDBAQVisibility.ON_COMMIT; - queueListen.DequeueOptions.Wait = 1; - EDBTransaction txn = null; - - while (1 == 1) - { - - if (queueListen.Connection.State == System.Data.ConnectionState.Closed) - { - queueListen.Connection.Open(); - } - - string messageId = "Unknown"; - try - { - // the listen function is a blocking function. It will Wait the specified waitTime or until a - // message is received. - Console.WriteLine("Listening..."); - string v = queueListen.Listen(null, waitTime); - // If we are waiting for a message and we specify a Wait time, - // then if there are no more messages, we want to just bounce out. - if (waitTime > -1 && v == null) - { - Console.WriteLine("No message received during Wait period."); - Console.WriteLine(); - continue; - } - - // once we're here that means a message has been detected in the queue. Let's deal with it. - txn = queueListen.Connection.BeginTransaction(); - - Console.WriteLine("Attempting to dequeue message..."); - // dequeue the message - EDBAQMessage deqMsg; - try - { - deqMsg = queueListen.Dequeue(); - } - catch (Exception ex) - { - if (ex.Message.Contains("ORA-25228")) - { - Console.WriteLine("Message was not there. Another process must have picked it up."); - Console.WriteLine(); - txn.Rollback(); - continue; - } - else - { - throw; - } - } - - messageId = ByteArrayToString((byte[])deqMsg.MessageId); - if (deqMsg != null) - { - Console.WriteLine("Processing received message..."); - // process the message payload - MyXML obj = (MyXML) deqMsg.Payload; - - QueuedEntities.Message msg = new Utils.XmlFragmentSerializer().Deserialize(obj.value); - - Console.WriteLine("Received Message:"); - Console.WriteLine("MessageID: " + messageId); - Console.WriteLine("Message: " + msg.MessageText); - Console.WriteLine("Enqueue Time" + queueListen.MessageProperties.EnqueueTime); - - txn.Commit(); - - Console.WriteLine("Finished processing message"); - Console.WriteLine(); - - } - else - { - Console.WriteLine("Message was not dequeued."); - } - } - catch (Exception ex) - { - Console.WriteLine("Failed To dequeue or process the dequeued message."); - Console.WriteLine(ex.ToString()); - Console.WriteLine(); - if (txn != null) - { - txn.Rollback(); - if (txn != null) - { - txn.Dispose(); - } - } - } - } - } - - } - } -} -``` - -## EDBAQ classes - -The following EDBAQ classes are used in this application: - -**EDBAQDequeueMode** - -The `EDBAQDequeueMode` class lists all the dequeuer modes available. - -| Value | Description | -| ------------- | ------------------------------------------------------------- | -| Browse | Reads the message without locking. | -| Locked | Reads and gets a write lock on the message. | -| Remove | Deletes the message after reading. This is the default value. | -| Remove_NoData | Confirms receipt of the message. | - -**EDBAQDequeueOptions** - -The `EDBAQDequeueOptions` class lists the options available when dequeuing a message. - -| Property | Description | -| -------------- | ------------------------------------------------------------------------------------------------------------------------------ | -| ConsumerName | The name of the consumer for which to dequeue the message. | -| DequeueMode | This is set from `EDBAQDequeueMode`. It represents the locking behavior linked with the dequeue option. | -| Navigation | This is set from `EDBAQNavigationMode`. It represents the position of the message to fetch. | -| Visibility | This is set from `EDBAQVisibility`. It represents whether the new message is dequeued as part of the current transaction. | -| Wait | The wait time for a message as per the search criteria. | -| Msgid | The message identifier. | -| Correlation | The correlation identifier. | -| DeqCondition | The dequeuer condition. It is a Boolean expression. | -| Transformation | The transformation to apply before dequeuing the message. | -| DeliveryMode | The delivery mode of the dequeued message. | - -**EDBAQEnqueueOptions** - -The `EDBAQEnqueueOptions` class lists the options available when enqueuing a message. - -| Property | Description | -| ----------------- | ------------------------------------------------------------------------------------------------------------------------------ | -| Visibility | This is set from `EDBAQVisibility`. It represents whether the new message is enqueued as part of the current transaction. | -| RelativeMsgid | The relative message identifier. | -| SequenceDeviation | The sequence when to dequeue the message. | -| Transformation | The transformation to apply before enqueuing the message. | -| DeliveryMode | The delivery mode of the enqueued message. | - -**EDBAQMessage** - -The `EDBAQMessage` class lists a message to enqueue/dequeue. - -| Property | Description | -| ------------ | -------------------------------- | -| Payload | The actual message to be queued. | -| MessageId | The ID of the queued message. | - -**EDBAQMessageProperties** - -The `EDBAQMessageProperties` lists the message properties available. - -| Property | Description | -| ---------------- | --------------------------------------------------------------------------------------------- | -| Priority | The priority of the message. | -| Delay | The duration post which the message is available for dequeuing, in seconds. | -| Expiration | The duration for which the message is available for dequeuing, in seconds. | -| Correlation | The correlation identifier. | -| Attempts | The number of attempts taken to dequeue the message. | -| RecipientList | The recipients list that overthrows the default queue subscribers. | -| ExceptionQueue | The name of the queue to move the unprocessed messages to. | -| EnqueueTime | The time when the message was enqueued. | -| State | The state of the message while dequeued. | -| OriginalMsgid | The message identifier in the last queue. | -| TransactionGroup | The transaction group for the dequeued messages. | -| DeliveryMode | The delivery mode of the dequeued message. | - -**EDBAQMessageState** - -The `EDBAQMessageState` class represents the state of the message during dequeue. - -| Value | Description | -| --------- | --------------------------------------------------------- | -| Expired | The message is moved to the exception queue. | -| Processed | The message is processed and kept. | -| Ready | The message is ready to be processed. | -| Waiting | The message is in waiting state. The delay isn't reached. | - -**EDBAQMessageType** - -The `EDBAQMessageType` class represents the types for payload. - -| Value | Description | -| --------- | ------------------------------------------------------------------------------------- | -| Raw | The raw message type.

Note: Currently, this payload type isn't supported. | -| UDT | The user defined type message. | -| XML | The XML type message.

Note: Currently, this payload type isn't supported. | - -**EDBAQNavigationMode** - -The `EDBAQNavigationMode` class represents the different types of navigation modes available. - -| Value | Description | -| ---------------- | ------------------------------------------------------------------ | -| First_Message | Returns the first available message that matches the search terms. | -| Next_Message | Returns the next available message that matches the search items. | -| Next_Transaction | Returns the first message of next transaction group. | - -**EDBAQQueue** - -The `EDBAQQueue` class represents a SQL statement to execute `DMBS_AQ` functionality on a PostgreSQL database. - -| Property | Description | -| ----------------- | --------------------------------------------------------------------------------------------- | -| Connection | The connection to use | -| Name | The name of the queue | -| MessageType | The message type that's enqueued/dequeued from this queue, for example `EDBAQMessageType.Udt` | -| UdtTypeName | The user-defined type name of the message type | -| EnqueueOptions | The enqueue options to use | -| DequeuOptions | The dequeue options to use | -| MessageProperties | The message properties to use | - -**EDBAQVisibility** - -The `EDBAQVisibility` class represents the visibility options available. - -| Value | Description | -| --------- | ----------------------------------------------------------- | -| Immediate | The enqueue/dequeue isn't part of the ongoing transaction. | -| On_Commit | The enqueue/dequeue is part of the current transaction. | - -!!! Note - - To review the default options for these parameters, see [DBMS_AQ](../../epas/11/epas_compat_bip_guide/03_built-in_packages/02_dbms_aq/). - - EDB advanced queueing functionality uses user-defined types for calling enqueue/dequeue operations. `Server Compatibility Mode=NoTypeLoading` can't be used with advanced queueing because `NoTypeLoading` doesn't load any user-defined types. diff --git a/product_docs/docs/net_connector/5.0.7.1/13_using_a_ref_cursor_in_a_net_application.mdx b/product_docs/docs/net_connector/5.0.7.1/13_using_a_ref_cursor_in_a_net_application.mdx deleted file mode 100644 index 1c338bbe855..00000000000 --- a/product_docs/docs/net_connector/5.0.7.1/13_using_a_ref_cursor_in_a_net_application.mdx +++ /dev/null @@ -1,105 +0,0 @@ ---- -title: "Using a ref cursor in a .NET application" - ---- - - - -A `ref cursor` is a cursor variable that contains a pointer to a query result set. The result set is determined by executing the `OPEN FOR` statement using the cursor variable. A cursor variable isn't tied to a particular query like a static cursor. You can open the same cursor variable a number of times with the `OPEN FOR` statement containing different queries and each time. A new result set is created for that query and made available by way of the cursor variable. You can declare a cursor variable in two ways: - -- Use the `SYS_REFCURSOR` built-in data type to declare a weakly typed ref cursor. -- Define a strongly typed ref cursor that declares a variable of that type. - -`SYS_REFCURSOR` is a ref cursor type that allows any result set to be associated with it. This is known as a weakly typed ref cursor. The following example is a declaration of a weakly typed ref cursor: - - `name SYS_REFCURSOR`; - -Following is an example of a strongly typed ref cursor: - - `TYPE IS REF CURSOR RETURN emp%ROWTYPE`; - -## Creating the stored procedure - -The following sample code creates a stored procedure called `refcur_inout_callee`. It specifies the data type of the ref cursor being passed as an OUT parameter. To create the sample procedure, invoke EDB-PSQL and connect to the EDB Postgres Advanced Server host database. Enter the following SPL code at the command line: - -```Text -CREATE OR REPLACE PROCEDURE - refcur_inout_callee(v_refcur OUT SYS_REFCURSOR) -IS -BEGIN - OPEN v_refcur FOR SELECT ename FROM emp; -END; -``` - -The following C# code uses the stored procedure to retrieve employee names from the `emp` table: - -```Text -using System; -using System.Data; -using EnterpriseDB.EDBClient; -using System.Configuration; - -namespace EDBRefCursor -{ - class EmpRefcursor - { - [STAThread] - static void Main(string[] args) - { - string strConnectionString = - ConfigurationManager.AppSettings["DB_CONN_STRING"]; - EDBConnection conn = new EDBConnection(strConnectionString); - conn.Open(); - try - { - EDBTransaction tran = conn.BeginTransaction(); - EDBCommand command = new EDBCommand("refcur_inout_callee", - conn); - command.CommandType = CommandType.StoredProcedure; - command.Transaction = tran; - command.Parameters.Add(new EDBParameter("refCursor", - EDBTypes.EDBDbType.Refcursor, 10, "refCursor", - - ParameterDirection.Output, false, 2, 2, - System.Data.DataRowVersion.Current, null)); - - command.Prepare(); - command.Parameters[0].Value = null; - - command.ExecuteNonQuery(); - String cursorName = command.Parameters[0].Value.ToString(); - command.CommandText = "fetch all in \"" + cursorName + "\""; - command.CommandType = CommandType.Text; - - EDBDataReader reader = - command.ExecuteReader(CommandBehavior.SequentialAccess); - int fc = reader.FieldCount; - while (reader.Read()) - { - for (int i = 0; i < fc; i++) - { - Console.WriteLine(reader.GetString(i)); - } - } - reader.Close(); - tran.Commit(); - } - catch (Exception ex) - { - Console.WriteLine(ex.Message.ToString()); - } - } - } -} -``` - -The following .NET code snippet displays the result on the console: - -```Text -for(int i = 0;i < fc; i++) -{ - Console.WriteLine(reader.GetString(i)); -} -``` - -You must bind the `EDBDbType.RefCursor` type in `EDBParameter()` if you're using a ref cursor parameter. diff --git a/product_docs/docs/net_connector/5.0.7.1/14_using_plugins.mdx b/product_docs/docs/net_connector/5.0.7.1/14_using_plugins.mdx deleted file mode 100644 index f4b10818555..00000000000 --- a/product_docs/docs/net_connector/5.0.7.1/14_using_plugins.mdx +++ /dev/null @@ -1,89 +0,0 @@ ---- -title: "Using plugins" - ---- - - - -EDB .Net driver plugins support the enhanced capabilities for different data types that are otherwise not available in .Net. The different plugins available support: - -- GeoJSON -- Json.NET -- Legacy PostGIS -- NetTopologySuite -- NodaTime -- Rawpostgis - -The plugins support the use of spatial, data/time, and JSON types. The following are the supported frameworks and data provider installation path for these plugins. - -## GeoJSON - -If you're using the GeoJSON plugin on .NET Standard 2.0, the data provider installation path is: - - `C:\Program Files\edb\dotnet\plugins\GeoJSON\netstandard2.0` - -The following shared library files are required: - -`EnterpriseDB.EDBClient.GeoJSON.dll` - -For detailed information about using the GeoJSON plugin, see the [Npgsql documentation](http://www.npgsql.org/doc/types/geojson.html). - -## Json.NET - -If you're using the Json.NET plugin on .NET Standard 2.0, the data provider installation path is: - - `C:\Program Files\edb\dotnet\plugins\Json.NET\netstandard2.0` - -The following shared library files are required: - -`EnterpriseDB.EDBClient.Json.NET.dll` - -For detailed information about using the Json.NET plugin, see the [Npgsql documentation](http://www.npgsql.org/doc/types/jsonnet.html). - -## LegacyPostGIS - -If you're using the LegacyPostGIS plugin on .Net Standard 2.0, the data provider installation path is: - - `C:\Program Files\edb\dotnet\plugins\LegacyPostgis\netstandard2.0` - -The following shared library files are required: - - `EnterpriseDB.EDBClient.LegacyPostgis.dll` - -For detailed information about using the LegacyPostGIS plugin, see the [Npgsql documentation](http://www.npgsql.org/doc/types/legacy-postgis.html). - -## NetTopologySuite - -If you're using the NetTopologySuite plugin on .Net Standard 2.0, the data provider installation path is: - - `C:\Program Files\edb\dotnet\plugins\NetTopologySuite\netstandard2.0` - -The following shared library files are required: - - `EnterpriseDB.EDBClient.NetTopologySuite.dll` - -For detailed information about using the NetTopologySuite type plugin, see the [Npgsql documentation](http://www.npgsql.org/doc/types/nts.html). - -## NodaTime - -If you're using the NodaTime plugin on .Net Standard 2.0, the data provider installation path is: - - `C:\Program Files\edb\dotnet\plugins\NodaTime\netstandard2.0` - -The following shared library files are required: - - `EnterpriseDB.EDBClient.NodaTime.dll` - -For detailed information about using the NodaTime plugin, see the [Npgsql documentation](http://www.npgsql.org/doc/types/nodatime.html). - -## RawPostGIS - -If you're using the RawPostGIS type plugin on .Net Standard 2.0, the data provider installation path is: - - `C:\Program\Files\edb\dotnet\plugins\RawPostGis\netstandard2.0` - -The following shared library files are required: - - `EnterpriseDB.EDBClient.RawPostgis.dll` - -For detailed information about using the RawPostGIS plugin, see the [documentation](https://www.nuget.org/packages/Npgsql.RawPostgis). diff --git a/product_docs/docs/net_connector/5.0.7.1/15_using_object_types.mdx b/product_docs/docs/net_connector/5.0.7.1/15_using_object_types.mdx deleted file mode 100644 index 909897b0e27..00000000000 --- a/product_docs/docs/net_connector/5.0.7.1/15_using_object_types.mdx +++ /dev/null @@ -1,185 +0,0 @@ ---- -title: "Using object types in .NET" - ---- - - - -The SQL `CREATE TYPE` command creates a user-defined object type, which is stored in the EDB Postgres Advanced Server database. - -You can then reference these user-defined types in SPL procedures, SPL functions, and .NET programs. - -The basic object type is created with the `CREATE TYPE AS OBJECT` command with optional use of the `CREATE TYPE BODY` command. - -## Using an object type - -To use an object type, you must first create the object type in the EDB Postgres Advanced Server database. Object type `addr_object_type` defines the attributes of an address: - -```text -CREATE OR REPLACE TYPE addr_object_type AS OBJECT -( - street VARCHAR2(30), - city VARCHAR2(20), - state CHAR(2), - zip NUMBER(5) -); -``` - -Object type `emp_obj_typ` defines the attributes of an employee. One of these attributes is object type `ADDR_OBJECT_TYPE`, as previously described. The object type body contains a method that displays the employee information: - -```text -CREATE OR REPLACE TYPE emp_obj_typ AS OBJECT -( - empno NUMBER(4), - ename VARCHAR2(20), - addr ADDR_OBJECT_TYPE, - MEMBER PROCEDURE display_emp(SELF IN OUT emp_obj_typ) -); - -CREATE OR REPLACE TYPE BODY emp_obj_typ AS - MEMBER PROCEDURE display_emp (SELF IN OUT emp_obj_typ) - IS - BEGIN - DBMS_OUTPUT.PUT_LINE('Employee No : ' || SELF.empno); - DBMS_OUTPUT.PUT_LINE('Name : ' || SELF.ename); - DBMS_OUTPUT.PUT_LINE('Street : ' || SELF.addr.street); - DBMS_OUTPUT.PUT_LINE('City/State/Zip: ' || SELF.addr.city || ', ' || - SELF.addr.state || ' ' || LPAD(SELF.addr.zip,5,'0')); - END; -END; -``` - -The following listing is a complete .NET program that uses these user-defined object types: - -```text -namespace ObjectTypesSample -{ - class Program - { - static void Main(string[] args) - { - EDBConnection.GlobalTypeMapper.MapComposite("enterprisedb.addr_object_type"); - EDBConnection.GlobalTypeMapper.MapComposite("enterprisedb.emp_obj_typ"); - EDBConnection conn = new EDBConnection("Server=localhost;Port=5444;database=test;User ID=enterprisedb;password=;"); - - try - { - conn.Open(); - - EDBCommand cmd = new EDBCommand("emp_obj_typ.display_emp", conn); - - cmd.CommandType = System.Data.CommandType.StoredProcedure; - EDBCommandBuilder.DeriveParameters(cmd); - - addr_object_type address = new addr_object_type() - { - street = "123 MAIN STREET", - city = "EDISON", - state = "NJ", - zip = 8817 - }; - - emp_obj_typ emp = new emp_obj_typ() - { - empno = 9001, - ename = "JONES", - addr = address - }; - cmd.Parameters[0].Value = emp; - cmd.Prepare(); - cmd.ExecuteNonQuery(); - - emp_obj_typ empOut = (emp_obj_typ)cmd.Parameters[0].Value; - Console.WriteLine("Emp No: " + empOut.empno); - Console.WriteLine("Emp Name: " + empOut.ename); - Console.WriteLine("Emp Address Street: " + empOut.addr.street); - Console.WriteLine("Emp Address City: " + empOut.addr.city); - Console.WriteLine("Emp Address State: " + empOut.addr.state); - Console.WriteLine("Emp Address Zip: " + empOut.addr.zip); - Console.WriteLine("Emp No: " + empOut.empno); - } - catch (EDBException exp) - { - Console.WriteLine(exp.Message.ToString()); - } - finally - { - conn.Close(); - } - } - } - - public class addr_object_type - { - public string street; - public string city; - public string state; - public decimal zip; - } - - public class emp_obj_typ - { - public decimal empno; - public string ename; - public addr_object_type addr; - } -} -``` - -The following .NET types are defined to map to the types in EDB Postgres Advanced Server: - -```text -public class addr_object_type -{ - public string street; - public string city; - public string state; - public decimal zip; -} - -public class emp_obj_typ -{ - public decimal empno; - public string ename; - public addr_object_type addr; -} -``` - -A call to `EDBConnection.GlobalTypeMapper.MapComposite` maps the .NET type to the EDB Postgres Advanced Server types: - -```text -EDBConnection.GlobalTypeMapper.MapComposite("enterprisedb.addr_object_type"); - EDBConnection.GlobalTypeMapper.MapComposite("enterprisedb.emp_obj_typ"); -``` - -A call to `EDBCommandBuilder.DeriveParameters()` gets parameter information for a stored procedure. This allows you to just set the parameter values and call the stored procedure: - -```text -EDBCommandBuilder.DeriveParameters(cmd); -``` - -The value of the parameter is set by creating an object of the .NET type and assigning it to the `Value` property of the parameter: - -```text -addr_object_type address = new addr_object_type() -{ - street = "123 MAIN STREET", - city = "EDISON", - state = "NJ", - zip = 8817 -}; - -emp_obj_typ emp = new emp_obj_typ() -{ - empno = 9001, - ename = "JONES", - addr = address -}; -cmd.Parameters[0].Value = emp; -``` - -A call to `cmd.ExecuteNonQuery()` executes the call to the `display_emp()` method: - -```text -cmd.ExecuteNonQuery(); -``` diff --git a/product_docs/docs/net_connector/5.0.7.1/16_scram_compatibility.mdx b/product_docs/docs/net_connector/5.0.7.1/16_scram_compatibility.mdx deleted file mode 100644 index 886739de0ae..00000000000 --- a/product_docs/docs/net_connector/5.0.7.1/16_scram_compatibility.mdx +++ /dev/null @@ -1,10 +0,0 @@ ---- -title: "Scram compatibility" -legacyRedirects: - - "/edb-docs/d/edb-postgres-net-connector/user-guides/net-guide/4.1.6.1/security_and_encryption.html" - ---- - - - -The EDB .NET driver provides SCRAM-SHA-256 support for EDB Postgres Advanced Server version 10 and above. This support is available from EDB .NET 4.0.2.1 release onwards. diff --git a/product_docs/docs/net_connector/5.0.7.1/17_advanced_server_net_connector_logging.mdx b/product_docs/docs/net_connector/5.0.7.1/17_advanced_server_net_connector_logging.mdx deleted file mode 100644 index 90c8a7c7122..00000000000 --- a/product_docs/docs/net_connector/5.0.7.1/17_advanced_server_net_connector_logging.mdx +++ /dev/null @@ -1,104 +0,0 @@ ---- -title: "EDB .NET Connector logging" - ---- - - - -EDB .NET Connector supports the use of logging to help resolve issues with the .NET Connector when used in your application. The connector uses classes in the `EnterpriseDB.EDBClient.Logging` namespace for logging. - -## Console logging to standard error - -`EnterpriseDB.EDBClient.Logging.ConsoleLoggingProvider` is a class that outputs error messages to `STDERR`. To use this class, include the following line in your application before using any of the EDB Postgres Advanced Server .NET Connector APIs. - -`EnterpriseDB.EDBClient.Logging.EDBLogManager.Provider = new EnterpriseDB.EDBClient.Logging.ConsoleLoggingProvider(EDBLogLevel.Debug, true, true);` - -The following log levels are available: - -- Trace -- Debug -- Info -- Warn -- Error -- Fatal - -## Writing a custom logger - -If the console logging provider doesn't meet your needs, you can write a custom logger by implementing the `EnterpriseDB.EDBClient.Logging.IEDBLoggingProvider` interface and extending the `EnterpriseDB.EDBClient.Logging.EDBLogger` class, for instance, writing your logs to a file. The following is a simple example of how to write a custom logger: - -```text -public class MyLoggingProvider : IEDBLoggingProvider - { - string _logFile; - readonly EDBLogLevel _minLevel; - readonly bool _printLevel; - readonly bool _printConnectorId; - - public MyLoggingProvider(string logFile, EDBLogLevel minLevel = EDBLogLevel.Info, bool printLevel = false, bool printConnectorId = false) - { - _logFile = logFile; - _minLevel = minLevel; - _printLevel = printLevel; - _printConnectorId = printConnectorId; - } - - public EDBLogger CreateLogger(string name) - { - return new MyLogger(_logFile, _minLevel, _printLevel, _printConnectorId); - } - } - - class MyLogger : EDBLogger - { - string _logFile; - readonly EDBLogLevel _minLevel; - readonly bool _printLevel; - readonly bool _printConnectorId; - - internal MyLogger(string logFile, EDBLogLevel minLevel, bool printLevel, bool printConnectorId) - { - _logFile = logFile; - _minLevel = minLevel; - _printLevel = printLevel; - _printConnectorId = printConnectorId; - } - - public override bool IsEnabled(EDBLogLevel level) => level >= _minLevel; - - public override void Log(EDBLogLevel level, int connectorId, string msg, Exception exception = null) - { - if (!IsEnabled(level)) - return; - - - using (StreamWriter writer = new StreamWriter(_logFile, true)) - { - var sb = new StringBuilder(); - if (_printLevel) - { - sb.Append(level.ToString().ToUpper()); - sb.Append(' '); - } - - if (_printConnectorId && connectorId != 0) - { - sb.Append("["); - sb.Append(connectorId); - sb.Append("] "); - } - - sb.AppendLine(msg); - - if (exception != null) - sb.AppendLine(exception.ToString()); - - writer.Write(sb.ToString()); - } - - } - } -``` - -To use this custom logger, put the following line in your application before using any of the EDB .NET Connector APIs: - -`EDBLogManager.Provider = new MyLoggingProvider(filepath, EDBLogLevel.Debug, true, true);` diff --git a/product_docs/docs/net_connector/5.0.7.1/18_api_reference.mdx b/product_docs/docs/net_connector/5.0.7.1/18_api_reference.mdx deleted file mode 100644 index 53050c37952..00000000000 --- a/product_docs/docs/net_connector/5.0.7.1/18_api_reference.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -title: "API reference" - ---- - - - -For information about using the API, see the [Npgsql documentation](http://www.npgsql.org/doc/api/Npgsql.html). - -Usage notes: - -- When using the API, replace references to `Npgsql` with `EnterpriseDB.EDBClient`. -- When referring to classes, replace `Npgsql` with `EDB`. For example, use the `EDBBinaryExporter` class instead of the `NpgsqlBinaryExporter` class. diff --git a/product_docs/docs/net_connector/5.0.7.1/images/connection_opened_successfully.png b/product_docs/docs/net_connector/5.0.7.1/images/connection_opened_successfully.png deleted file mode 100755 index bab12126d20..00000000000 --- a/product_docs/docs/net_connector/5.0.7.1/images/connection_opened_successfully.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:537e7edecce3882b794110e0ffc644a51cab69ba2c7e7f82a3e99d32c4b4ba65 -size 22683 diff --git a/product_docs/docs/net_connector/5.0.7.1/images/dialog.png b/product_docs/docs/net_connector/5.0.7.1/images/dialog.png deleted file mode 100755 index 19cba54d1f9..00000000000 --- a/product_docs/docs/net_connector/5.0.7.1/images/dialog.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:f922e6cd4e43927708b5f460f5389a5b3a41dd70f3a5394723e6aee7d710f1ae -size 9048 diff --git a/product_docs/docs/net_connector/5.0.7.1/images/dotnet_installation_complete.png b/product_docs/docs/net_connector/5.0.7.1/images/dotnet_installation_complete.png deleted file mode 100755 index 332ae795899..00000000000 --- a/product_docs/docs/net_connector/5.0.7.1/images/dotnet_installation_complete.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:0983f216ce071f57f7e758980c3f966caded4312412905a6aba66efa362fdb13 -size 272137 diff --git a/product_docs/docs/net_connector/5.0.7.1/images/dotnet_installation_dialog.png b/product_docs/docs/net_connector/5.0.7.1/images/dotnet_installation_dialog.png deleted file mode 100755 index b465d536032..00000000000 --- a/product_docs/docs/net_connector/5.0.7.1/images/dotnet_installation_dialog.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:994a725f061f1b51fd92ccc2df5abd9066a1cf4ea7600611ae57ebc6cc59af20 -size 51144 diff --git a/product_docs/docs/net_connector/5.0.7.1/images/dotnet_installation_wizard.png b/product_docs/docs/net_connector/5.0.7.1/images/dotnet_installation_wizard.png deleted file mode 100755 index 29c9a7f99f9..00000000000 --- a/product_docs/docs/net_connector/5.0.7.1/images/dotnet_installation_wizard.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:efe8029105db01662005a349a7b59c87b6f7dce3017990a197e3b9b681392860 -size 227235 diff --git a/product_docs/docs/net_connector/5.0.7.1/images/ready_to_install.png b/product_docs/docs/net_connector/5.0.7.1/images/ready_to_install.png deleted file mode 100755 index 59e44d96bc5..00000000000 --- a/product_docs/docs/net_connector/5.0.7.1/images/ready_to_install.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:91b18bef7b78a6dae7d6b664e2bccfbfdb4248dbd034cb59e2c6a35ada7da49c -size 44080 diff --git a/product_docs/docs/net_connector/5.0.7.1/images/selecting_the_connectors_installer.png b/product_docs/docs/net_connector/5.0.7.1/images/selecting_the_connectors_installer.png deleted file mode 100755 index 432e4473c09..00000000000 --- a/product_docs/docs/net_connector/5.0.7.1/images/selecting_the_connectors_installer.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:d939c7e6604025f82be47969d69e6acc63ab5a48a0af4341e42efe0156b42778 -size 97808 diff --git a/product_docs/docs/net_connector/5.0.7.1/images/starting_stackbuilder_plus.png b/product_docs/docs/net_connector/5.0.7.1/images/starting_stackbuilder_plus.png deleted file mode 100755 index 11665300652..00000000000 --- a/product_docs/docs/net_connector/5.0.7.1/images/starting_stackbuilder_plus.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:ce6bcefb865ca14239fb7e0e2ac5149ed56251cfbc5153869070d039f70857c6 -size 91989 diff --git a/product_docs/docs/net_connector/5.0.7.1/index.mdx b/product_docs/docs/net_connector/5.0.7.1/index.mdx deleted file mode 100644 index 96856a8aa09..00000000000 --- a/product_docs/docs/net_connector/5.0.7.1/index.mdx +++ /dev/null @@ -1,20 +0,0 @@ ---- -title: "EDB .NET Connector" -directoryDefaults: - description: "EDB .NET Connector Version 5.0.7.1 Documentation and release notes." -pdf: true ---- - -The EDB .NET Connector distributed with EDB Postgres Advanced Server provides connectivity between a .NET client application and an EDB Postgres Advanced Server database server. You can: - -- Connect to an instance of EDB Postgres Advanced Server. -- Retrieve information from an EDB Postgres Advanced Server database. -- Update information stored on an EDB Postgres Advanced Server database. - -To understand these examples, you need a solid working knowledge of C# and .NET. The EDB .NET Connector functionality is built on the core functionality of the Npgsql open source project. For details, see the [Npgsql User Guide](http://www.npgsql.org/doc/index.html). - -
- -release_notes requirements_overview the_advanced_server_net_connector_overview installing_and_configuring_the_net_connector using_the_net_connector opening_a_database_connection retrieving_database_records parameterized_queries inserting_records_in_a_database deleting_records_in_a_database using_spl_stored_procedures_in_your_net_application using_advanced_queueing using_a_ref_cursor_in_a_net_application using_plugins using_object_types scram_compatibility advanced_server_net_connector_logging api_reference conclusion - -
diff --git a/product_docs/docs/net_connector/6.0.2.1/02_requirements_overview.mdx b/product_docs/docs/net_connector/6.0.2.1/02_requirements_overview.mdx deleted file mode 100644 index 60a3b1300bc..00000000000 --- a/product_docs/docs/net_connector/6.0.2.1/02_requirements_overview.mdx +++ /dev/null @@ -1,20 +0,0 @@ ---- -title: "Product compatability" ---- - - - -These are the supported versions and platforms for the EDB .NET Connector. - -The EDB .NET Connector is certified with EDB Postgres Advanced Server version 10 and later. - -The EDB .NET Connector graphical installers are supported on the following Windows platforms: - -64-bit Windows: - -- Windows Server 2019 -- Windows 10 - -32-bit Windows: - -- Windows 10 diff --git a/product_docs/docs/net_connector/6.0.2.1/03_the_advanced_server_net_connector_overview.mdx b/product_docs/docs/net_connector/6.0.2.1/03_the_advanced_server_net_connector_overview.mdx deleted file mode 100644 index e0dde60272e..00000000000 --- a/product_docs/docs/net_connector/6.0.2.1/03_the_advanced_server_net_connector_overview.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -title: "The EDB .NET Connector overview" - ---- - - - -The EDB .NET Connector is a .NET data provider that allows a client application to connect to a database stored on an EDB Postgres Advanced Server host. The .NET Connector accesses the data directly, allowing the client application optimal performance, a broad spectrum of functionality, and access to EDB Postgres Advanced Server features. - -The .NET Connector supports the following frameworks: - -- .NET 6.0 -- .NET 5.0 -- .NET Core 3.1 -- .NET Standard 2.0 and 2.1 - - -## The .NET class hierarchy - -The .NET class hierarchy contains classes that you can use to create objects that control a connection to the EDB Postgres Advanced Server database and manipulate the data stored on the server. The following are just a few of the most commonly used object classes. - -`EDBConnection` - - The `EDBConnection` class represents a connection to EDB Postgres Advanced Server. An `EDBConnection` object contains a `ConnectionString` that instructs the .NET client how to connect to an EDB Postgres Advanced Server database. - -`EDBCommand` - - An `EDBCommand` object contains an SQL command that the client executes against EDB Postgres Advanced Server. Before you can execute an `EDBCommand` object, you must link it to an `EDBConnection` object. - -`EDBDataReader` - - An `EDBDataReader` object provides a way to read an EDB Postgres Advanced Server result set. You can use an `EDBDataReader` object to step through one row at a time, forward only. - -`EDBDataAdapter` - - An `EDBDataAdapter` object links a result set to the EDB Postgres Advanced Server database. You can modify values and use the `EDBDataAdapter` class to update the data stored in an EDB Postgres Advanced Server database. diff --git a/product_docs/docs/net_connector/6.0.2.1/04_installing_and_configuring_the_net_connector.mdx b/product_docs/docs/net_connector/6.0.2.1/04_installing_and_configuring_the_net_connector.mdx deleted file mode 100644 index d80da46c84a..00000000000 --- a/product_docs/docs/net_connector/6.0.2.1/04_installing_and_configuring_the_net_connector.mdx +++ /dev/null @@ -1,269 +0,0 @@ ---- -title: "Installing and configuring the .NET Connector" - ---- - - - -## Installing the .NET Connector - -You can use the EDB .NET Connector Installer (available [from the EDB website](https://www.enterprisedb.com/software-downloads-postgres)) to add the .NET Connector to your system. After downloading the installer, right-click on the installer icon, and select `Run As Administrator` from the context menu. When prompted, select an installation language and click `OK` to continue to the `Setup` window. - -![The .NET Connector Installation wizard](images/dotnet_installation_wizard.png) - -
The .NET Connector Installation wizard
- -Click `Next` to continue. - -![The Installation dialog](images/dotnet_installation_dialog.png) - -
The Installation dialog
- -Use the `Installation Directory` dialog to specify the directory in which the connector will be installed, and click `Next` to continue. - -![The Ready to Install dialog](images/ready_to_install.png) - -
The Ready to Install dialog
- -Click `Next` on the `Ready to Install` dialog to start the installation; popup dialogs confirm the progress of the installation wizard. - -![The installation is complete](images/dotnet_installation_complete.png) - -
The installation is complete
- -When the wizard informs you that it has completed the setup, click the `Finish` button to exit the dialog. - -You can also use StackBuilder Plus to add or update the connector on an existing Advanced Server installation; to open StackBuilder Plus, select `StackBuilder Plus` from the Windows `Apps` menu. - -![Starting StackBuilder Plus](images/starting_stackbuilder_plus.png) - -
Starting StackBuilder Plus
- -When StackBuilder Plus opens, follow the onscreen instructions. - -Select the `EnterpriseDB.Net Connector` option from the `Database Drivers` node of the tree control. - -![Selecting the Connectors installer](images/selecting_the_connectors_installer.png) - -
Selecting the Connectors installer
- -Follow the directions of the onscreen wizard to add or update an installation of an EDB Connector. - -## Configuring the .NET Connector - -Please see the following environment-specific sections for information about configuring the .NET Connector: - -- **Referencing the Library Files.** [General configuration information](#referencing_the_library_files) applicable to all components. -- **.NET 6.0** Instructions for configuring for use with [.NET 6.0](#setup_6_0). -- **.NET 5.0** Instructions for configuring for use with [.NET 5.0](#setup_5_0). -- **.NET Core 3.1** Instructions for configuring for use with [.NET Core 3.1](#framework_setup_core3_1). -- **.NET Standard 2.0** Instructions for configuring for use with [.NET Standard 2.0](#standard_setup_2). -- **.NET Standard 2.1** Instructions for configuring for use with [.NET Standard 2.1](#standard_setup_2_1). -- **.NET EntityFramework Core** Instructions for configuring for use with [.NET EntityFramework Core](#entity_setup). - - - -### Referencing the library files - - - -To reference library files with Microsoft Visual Studio: - -1. Select the project in the `Solution Explorer`. -2. Select `Add Reference` from the `Project` menu. -3. When the `Add Reference` dialog box opens, browse to select the appropriate library files. - -Optionally, the library files can be copied to the specified location. - -Before you can use an EDB .NET class, you must import the namespace into your program. Importing a namespace makes the compiler aware of the classes available within the namespace. The namespace is: - - `EnterpriseDB.EDBClient` - -The method you use to include the namespace varies by the type of application you are writing. For example, the following command imports a namespace into an `ASP.NET` page: - - `<% import namespace="EnterpriseDB.EDBClient" %>` - -To import a namespace into a C# application, write: - - `using EnterpriseDB.EDBClient;` - -### .NET framework setup - -The following sections describe the setup for various .NET versions. - - - -#### .NET 6.0 - -For .NET 6.0, the data provider installation path is: - - `C:\Program Files\edb\dotnet\net6.0\` - -You must add the following dependencies to your project: - - `EnterpriseDB.EDBClient.dll` - -Depending upon the type of application you use, you may be required to import the namespace into the source code. See [Referencing the Library Files](#referencing_the_library_files) for this and other information about referencing library files. - - - -#### .NET 5.0 - -For .NET 5.0, the data provider installation path is: - - `C:\Program Files\edb\dotnet\net5.0\` - -You must add the following dependencies to your project: - - `EnterpriseDB.EDBClient.dll` - -Depending upon the type of application you use, you may be required to import the namespace into the source code. See [Referencing the Library Files](#referencing_the_library_files) for this and other information about referencing library files. - - - -#### .NET Core 3.1 - -If you are using .NET Core 3.1, the data provider installation path is: - - `C:\Program Files\edb\dotnet\netcoreapp3.1\` - -The following shared library files are required: - - `EnterpriseDB.EDBClient.dll` - - `System.Threading.Tasks.Extensions.dll` - - `System.Runtime.CompilerServices.Unsafe.dll` - - `System.ValueTuple.dll` - - `System.Memory.dll` - -Depending upon the type of application you use, you may be required to import the namespace into the source code. See [Referencing the Library Files](#referencing_the_library_files) for this and other information about referencing library files. - - - -#### .NET Standard 2.0 - -For .NET Standard Framework 2.0, the data provider installation path is: - - `C:\Program Files\edb\dotnet\netstandard2.0\` - -You must add the following dependencies to your project: - - `EnterpriseDB.EDBClient.dll` - - `System.Threading.Tasks.Extensions.dll` - - `System.Runtime.CompilerServices.Unsafe.dll` - - `System.ValueTuple.dll` - -!!! Note - If your target framework is .Net Core 2.0, then include the following file in your project: - -`System.Threading.Tasks.Extensions.dll` - -Depending upon the type of application you use, you may be required to import the namespace into the source code. See [Referencing the Library Files](#referencing_the_library_files) for this and other information about referencing library files. - - - -#### .NET Standard 2.1 - -For .NET Standard Framework 2.1, the data provider installation path is: - - `C:\Program Files\edb\dotnet\netstandard2.1\` - -The following shared library files are required: - - `EnterpriseDB.EDBClient.dll` - - `System.Memory.dll` - - `System.Runtime.CompilerServices.Unsafe.dll` - - `System.Text.Json.dll` - - `System.Threading.Tasks.Extensions.dll` - - `System.ValueTuple.dll` - -Depending upon the type of application you use, you may be required to import the namespace into the source code. See [Referencing the Library Files](#referencing_the_library_files) for this and other information about referencing library files. - - - -#### .NET EntityFramework Core - -To configure the .NET Connector for use with Entity Framework Core, the data provider installation path is: - - `C:\Program Files\edb\dotnet\EFCore` - -The following shared library file is required: - - `EnterpriseDB.EDBClient.EntityFrameworkCore.PostgreSQL.dll` - -!!! Note - - Entity Framework Core can be used with the EnterpriseDB.EDBClient.dll library available in the net6.0 subdirectory. - - -See [Referencing the Library Files](#referencing_the_library_files) for information about referencing library files. - -The following NuGet packages are required: - - `Microsoft.EntityFrameworkCore.Design` - - `Microsoft.EntityFrameworkCore.Relational` - - `Microsoft.EntityFrameworkCore.Abstractions` - - -For usage information about Entity Framework Core, refer to the Microsoft documentation. - -**Prerequisite**: - -Install dotnet-ef (using Command Prompt) - - `dotnet tool install --global dotnet-ef` - -**Sample project** - -Create a new Console Application based on .NET 6.0. - -Add Reference to the following EDB assemblies: - - `EnterpriseDB.EDBClient.EntityFrameworkCore.PostgreSQL.dll` - - `EnterpriseDB.EDBClient.dll` - -Add the following NuGet packages: - - `Microsoft.EntityFrameworkCore.Design` - - `Microsoft.EntityFrameworkCore.Relational` - - `Microsoft.EntityFrameworkCore.Abstractions` - - -Command Prompt - - `Open Tools` → `Command Line` → `Developer Command Prompt` - -**Database first scenario** - -Issue the following command to create Model Classes corresponding to all objects in the specified database: - -`dotnet ef dbcontext scaffold Host=;Database=;Username=;Password=;Port= EnterpriseDB.EDBClient.EntityFrameworkCore.PostgreSQL -o Models` - -**Code first scenario** - -Add code for defining a DbContext and create, read, update & delete operations. - -Please refer to the Microsoft documentation for further details. - -Issue the following commands to create the initial database and tables: - - `dotnet ef migrations add InitialCreate --context BloggingContext` - - `dotnet ef database update --context BloggingContext` - diff --git a/product_docs/docs/net_connector/6.0.2.1/05_using_the_net_connector.mdx b/product_docs/docs/net_connector/6.0.2.1/05_using_the_net_connector.mdx deleted file mode 100644 index dcdac30a376..00000000000 --- a/product_docs/docs/net_connector/6.0.2.1/05_using_the_net_connector.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -title: "Using the .NET Connector" - ---- - - - -These examples show how you can use the EDB object classes that are provided by the EDB .NET Connector that allow a .NET application to connect to and interact with an EDB Postgres Advanced Server database. - -To use these examples, place the .NET library files in the same directory as the compiled form of your application. All of these examples are written in C#, and each is embedded in an ASP.NET page. The same logic and code applies to other .NET applications (WinForm or console applications, for example). - -Create and save the following `web.config` file in the same directory as the sample code. The examples make use of the `DB_CONN_STRING` key from this configuration file to return a connection string from the EDB Postgres Advanced Server host. - -```text - - - - - - -``` - -An EDB Postgres Advanced Server connection string for an ASP.NET web application is stored in the `web.config` file. If you're writing an application that doesn't use ASP.NET, provide the connection information in an application configuration file such as `app.config`. diff --git a/product_docs/docs/net_connector/6.0.2.1/06_opening_a_database_connection.mdx b/product_docs/docs/net_connector/6.0.2.1/06_opening_a_database_connection.mdx deleted file mode 100644 index f6fe28be1aa..00000000000 --- a/product_docs/docs/net_connector/6.0.2.1/06_opening_a_database_connection.mdx +++ /dev/null @@ -1,279 +0,0 @@ ---- -title: "Opening a database connection" - ---- - - - -An `EDBConnection` object is responsible for handling the communication between an instance of EDB Postgres Advanced Server and a .NET application. Before you can access data stored in an EDB Postgres Advanced Server database, you must create and open an `EDBConnection` object. - -The examples that follow show the basic steps for connecting to an instance of Advanced Server. You must: - -1. Import the namespace `EnterpriseDB.EDBClient`. -2. Create an instance of `EDBConnection`. -3. Initialize the `EDBConnection` object by passing a connection string as a parameter to the constructor for the `EDBConnection` class. -4. Call the `Open` method of the `EDBConnection` object to open the connection. - - - -## Connection string parameters - -A valid connection string specifies location and authentication information for an EDB Postgres Advanced Server instance. You must provide the connection string before opening the connection. A connection string must contain: - -- The name or IP address of the server -- The name of the EDB Postgres Advanced Server database -- The name of an EDB Postgres Advanced Server user -- The password associated with that user - -You can include the following parameters in the connection string: - -`CommandTimeout` - - `CommandTimeout` specifies the length of time (in seconds) to wait for a command to finish executing before throwing an exception. The default value is `20`. - -`ConnectionLifeTime` - - Use `ConnectionLifeTime` to specify the length of time (in seconds) to wait before closing unused connections in the pool. The default value is `15`. - -`Database` - - Use the `Database` parameter to specify the name of the database for the application to connect to. The default is the name of the connecting user. - -`Encoding` - - The `Encoding` parameter is obsolete. The parameter always returns the string `unicode` and silently ignores attempts to set it. - -`Integrated Security` - - Specify a value of `true` to use Windows Integrated Security. By default, `Integrated Security` is set to `false`, and Windows Integrated Security is disabled. - -`Load Role Based Tables` - - Use `Load Role Based Tables` to load table OIDs based on role. This change impacts only the loading of table type OID and not the composite type. Setting this parameter to `true` triggers the new functionality. The default value is `false`. - -`MaxPoolSize` - - `MaxPoolSize` instructs `EDBConnection` to dispose of pooled connections when the pool exceeds the specified number of connections. The default value is `20`. - -`MinPoolSize` - - `MinPoolSize` instructs `EDBConnection` to preallocate the specified number of connections with the server. The default value is `1`. - -`Password` - - When using clear text authentication, specify the password to use to establish a connection with the server. - -`Pooling` - - Specify a value of `false` to disable connection pooling. By default, `Pooling` is set to `true` to enable connection pooling. - -`No Reset On Close` - -When `Pooling` is enabled and the connection is closed, reopened, and the underlying connection is reused, then some operations are executed to discard the previous connection resources. It is possible to override this behavior by enabling `No Reset On Close`. - -`Port` - - The `Port` parameter specifies the port for the application to connect to. - -`Protocol` - - The specific protocol version to use (instead of automatic). Specify an integer value of `2` or `3`. - -`SearchPath` - - Use the `SearchPath` parameter to change the search path to named and public schemas. - -`Server` - - The name or IP address of the EDB Postgres Advanced Server host. - -`SSL` - - Specify a value of `true` to attempt a secure connection. By default, `SSL` is set to `false`. - -`sslmode` - - Use `sslmode` to specify an SSL connection control preference. `sslmode` can be: - - `prefer` — Use SSL if possible. - - `require` — Throw an exception if an SSL connection can't be established. - - `allow` — Connect without SSL. This parameter isn't supported. - - `disable` — Don't attempt an SSL connection. This is the default behavior. - -`SyncNotification` - - Use the `SyncNotification` parameter to specify for `EDBDataprovider` to use synchronous notifications. The default value is `false`. - -`Timeout` - - `Timeout` specifies the length of time (in seconds) to wait for an open connection. The default value is `15`. - -`User Id` - - The `User Id` parameter specifies the user name to use for the connection. - -## Example: Opening a database connection using ASP.NET - -This example shows how to open a connection to an instance of EDB Postgres Advanced Server and then close the connection. The connection is established using the credentials specified in the `DB_CONN_STRING` configuration parameter. See [Using the .Net Connector](05_using_the_net_connector/#using_the_net_connector) for an introduction to connection information. Also see [Connection string parameters](#connection-string-parameters) for connection parameters. - -```Text -<% @ Page Language="C#" %> -<% @Import Namespace="EnterpriseDB.EDBClient" %> -<% @Import Namespace="System.Configuration" %> - - -``` - -If the connection is successful, a message appears indicating that the connection opened successfully. - -## Example: Opening a database connection from a console application - -This example opens a connection with an EDB Postgres Advanced Server database using a console-based application. - -Before writing the code for the console application, create an `app.config` file that stores the connection string to the database. Using a configuration file makes it convenient to update the connection string if the information changes. - -```Text - - - - - - -``` - -Enter the following code sample into a file: - -```Text -using System; -using System.Data; -using EnterpriseDB.EDBClient; -using System.Configuration; - -namespace EnterpriseDB -{ - - class EDB - { - - static void Main(string[] args) - { - string strConnectionString = ConfigurationManager.AppSettings - ["DB_CONN_STRING"]; - - EDBConnection conn = new EDBConnection(strConnectionString); - - try - { - conn.Open(); - Console.WriteLine("Connection Opened Successfully"); - } - - catch(Exception exp) - { - throw new Exception(exp.ToString()); - } - - finally - { - conn.Close(); - } - } - } -} -``` - -Save the file as `EDBConnection-Sample.cs` and compile it with the following command: - -`csc /r:EnterpriseDB.EDBClient.dll /out:Console.exe EDBConnection-Sample.cs` - -Compiling the sample generates a `Console.exe` file. You can execute the sample code by entering `Console.exe`. When executed, the console verifies that it opened successfully. - -## Example: Opening a database connection from a Windows form application - -This example opens a database connection using a .NET WinForm application. To use the example, save the following code as `WinForm-Example.cs` in a directory that contains the library files. - -```Text -using System; -using System.Windows.Forms; -using System.Drawing; -using EnterpriseDB.EDBClient; - -namespace EDBTestClient -{ - - class Win_Conn - { - static void Main(string[] args) - { - Form frmMain = new Form(); - Button btnConn = new Button(); - btnConn.Location = new System.Drawing.Point(104, 64); - btnConn.Name = "btnConn"; - btnConn.Text = "Open Connection"; - btnConn.Click += new System.EventHandler(btnConn_Click); - - frmMain.Controls.Add(btnConn); - frmMain.Text = "EnterpriseDB"; - - Application.Run(frmMain); - } - - private static void btnConn_Click(object sender, System.EventArgs e) - { - EDBConnection conn = null; - try - { - string connectionString = "Server=10.90.1.29;port=5444; - username=edb;password=edb;database=edb"; - conn = new EDBConnection(connectionString); - conn.Open(); - MessageBox.Show("Connection Open"); - } - catch(EDBException exp) - { - MessageBox.Show(exp.ToString()); - } - finally - { - conn.Close(); - } - } - } -} -``` - -Change the database connection string to point to the database that you want to connect to. Then compile the file with the following command: - -`csc /r:EnterpriseDB.EDBClient.dll /out:WinForm.exe WinForm-Example.cs` - -This command generates a `WinForm.exe` file in the same folder that the executable was compiled under. Invoking the executable displays a message that the connection was successful. diff --git a/product_docs/docs/net_connector/6.0.2.1/07_retrieving_database_records.mdx b/product_docs/docs/net_connector/6.0.2.1/07_retrieving_database_records.mdx deleted file mode 100644 index 08e0db54530..00000000000 --- a/product_docs/docs/net_connector/6.0.2.1/07_retrieving_database_records.mdx +++ /dev/null @@ -1,120 +0,0 @@ ---- -title: "Retrieving database records" - ---- - - - -You can use a `SELECT` statement to retrieve records from the database using a `SELECT` command. To execute a `SELECT` statement you must: - -- Create and open a database connection. -- Create an `EDBCommand` object that represents the `SELECT` statement. -- Execute the command with the `ExecuteReader()` method of the `EDBCommand` object returning `EDBDataReader`. -- Loop through the `EDBDataReader`, displaying the results or binding the `EDBDataReader` to some control. - -An `EDBDataReader` object represents a forward-only and read-only stream of database records, presented one record at a time. To view a subsequent record in the stream, you must call the `Read()` method of the `EDBDataReader` object. - -The example that follows: - -1. Imports the EDB Postgres Advanced Server namespace `EnterpriseDB.EDBClient`. -2. Initializes an `EDBCommand` object with a `SELECT` statement. -3. Opens a connection to the database. -4. Executes the `EDBCommand` by calling the `ExecuteReader` method of the `EDBCommand` object. - -The results of the SQL statement are retrieved into an `EDBDataReader` object. - -Loop through the contents of the `EDBDataReader` object to display the records returned by the query in a `WHILE` loop. - -The `Read()` method advances to the next record (if a record exists) and returns `true` if a record exists. It returns `false` if `EDBDataReader` has reached the end of the result set. - -```Text -<% @ Page Language="C#" %> -<% @Import Namespace="EnterpriseDB.EDBClient" %> -<% @Import Namespace="System.Data" %> -<% @Import Namespace="System.Configuration" %> - - -``` - -To exercise the sample code, save the code in your default web root directory in a file named `selectEmployees.aspx`. Then, to invoke the program, enter the following URL into a browser: `http://localhost/selectEmployees.aspx`. - -## Retrieving a single database record - -To retrieve a single result from a query, use the `ExecuteScalar()` method of the `EDBCommand` object. The `ExecuteScalar()` method returns the first value of the first column of the first row of the `DataSet` generated by the specified query. - -```text -<% @ Page Language="C#" %> -<% @Import Namespace="EnterpriseDB.EDBClient" %> -<% @Import Namespace="System.Data" %> -<% @Import Namespace="System.Configuration" %> - - -``` - -Save the sample code in a file named `selectscalar.aspx` in a web root directory. - -To invoke the sample code, enter the following in a browser: `http://localhost/selectScalar.aspx` - -The sample includes an explicit conversion of the value returned by the `ExecuteScalar()` method. The `ExecuteScalar()` method returns an object. To view the object, you must convert it to an integer value by using the `Convert.ToInt32` method. diff --git a/product_docs/docs/net_connector/6.0.2.1/08_parameterized_queries.mdx b/product_docs/docs/net_connector/6.0.2.1/08_parameterized_queries.mdx deleted file mode 100644 index a6a3db44020..00000000000 --- a/product_docs/docs/net_connector/6.0.2.1/08_parameterized_queries.mdx +++ /dev/null @@ -1,59 +0,0 @@ ---- -title: "Parameterized queries" - ---- - - - -A _parameterized query_ is a query with one or more parameter markers embedded in the SQL statement. Before executing a parameterized query, you must supply a value for each marker found in the text of the SQL statement. - -Parameterized queries are useful when you don't know the complete text of a query when you write your code. For example, the value referenced in a `WHERE` clause can be calculated from user input. - -As shown in the following example, you must declare the data type of each parameter specified in the parameterized query by creating an `EDBParameter` object and adding that object to the command's parameter collection. Then, you must specify a value for each parameter by calling the parameter's `Value()` function. - -The example shows using a parameterized query with an `UPDATE` statement that increases an employee salary: - -```text -<% @ Page Language="C#" Debug="true"%> -<% @Import Namespace="EnterpriseDB.EDBClient" %> -<% @Import Namespace="System.Data" %> -<% @Import Namespace="System.Configuration" %> - - -``` - -Save the sample code in a file named `updateSalary.aspx` in a web root directory. - -To invoke the sample code, enter the following in a browser: `http://localhost/updateSalary.aspx` diff --git a/product_docs/docs/net_connector/6.0.2.1/09_inserting_records_in_a_database.mdx b/product_docs/docs/net_connector/6.0.2.1/09_inserting_records_in_a_database.mdx deleted file mode 100644 index a08fcf70866..00000000000 --- a/product_docs/docs/net_connector/6.0.2.1/09_inserting_records_in_a_database.mdx +++ /dev/null @@ -1,64 +0,0 @@ ---- -title: "Inserting records in a database" - ---- - - - -You can use the `ExecuteNonQuery()` method of `EDBCommand` to add records to a database stored on an EDB Postgres Advanced Server host with an `INSERT` command. - -In the example that follows, the `INSERT` command is stored in the variable `cmd`. The values prefixed with a colon (`:`) are placeholders for `EDBParameters` that are instantiated, assigned values, and then added to the `INSERT` command's parameter collection in the statements that follow. The `INSERT` command is executed by the `ExecuteNonQuery()` method of the `cmdInsert` object. - -The example adds an employee to the `emp` table: - -```Text -<% @ Page Language="C#" Debug="true"%> -<% @Import Namespace="EnterpriseDB.EDBClient" %> -<% @Import Namespace="System.Data" %> -<% @Import Namespace="System.Configuration" %> - - -``` - -Save the sample code in a file named `insertEmployee.aspx` in a web root directory. - -To invoke the sample code, enter the following in a browser: `http://localhost/insertEmployee.aspx` diff --git a/product_docs/docs/net_connector/6.0.2.1/10_deleting_records_in_a_database.mdx b/product_docs/docs/net_connector/6.0.2.1/10_deleting_records_in_a_database.mdx deleted file mode 100644 index ac5545aeb44..00000000000 --- a/product_docs/docs/net_connector/6.0.2.1/10_deleting_records_in_a_database.mdx +++ /dev/null @@ -1,65 +0,0 @@ ---- -title: "Deleting records in a database" - ---- - - - -You can use the `ExecuteNonQuery()` method of `EDBCommand` to delete records from a database stored on an EDB Postgres Advanced Server host with a `DELETE` statement. - -In the example that follows, the `DELETE` command is stored in the variable `strDeleteQuery`. The code passes the employee number to the `DELETE` command (specified by `EmpNo`). The command is then executed using the `ExecuteNonQuery()` method. - -```text -<% @ Page Language="C#" Debug="true"%> -<% @Import Namespace="EnterpriseDB.EDBClient" %> -<% @Import Namespace="System.Data" %> -<% @Import Namespace="System.Configuration" %> - - -``` - -Save the sample code in a file named `deleteEmployee.aspx` in a web root directory. - -To invoke the sample code, enter the following in a browser: `http://localhost/deleteEmployee.aspx` diff --git a/product_docs/docs/net_connector/6.0.2.1/11_using_spl_stored_procedures_in_your_net_application.mdx b/product_docs/docs/net_connector/6.0.2.1/11_using_spl_stored_procedures_in_your_net_application.mdx deleted file mode 100644 index 3950edbe6b6..00000000000 --- a/product_docs/docs/net_connector/6.0.2.1/11_using_spl_stored_procedures_in_your_net_application.mdx +++ /dev/null @@ -1,409 +0,0 @@ ---- -title: "Using SPL stored procedures in your .NET application" - ---- - - - -You can include SQL statements in an application in two ways: - -- By adding the SQL statements directly in the .NET application code. -- By packaging the SQL statements in a stored procedure and executing the stored procedure from the .NET application. - -In some cases, a stored procedure can provide advantages over embedded SQL statements. Stored procedures support complex conditional and looping constructs that are difficult to duplicate with SQL statements embedded directly in an application. - -You can also see an improvement in performance by using stored procedures. A stored procedure needs to be parsed, compiled, and optimized only once on the server side. A SQL statement that's included in an application might be parsed, compiled, and optimized each time it's executed from a .NET application. - -To use a stored procedure in your .NET application you must: - -1. Create an SPL stored procedure on the EDB Postgres Advanced Server host. -2. Import the `EnterpriseDB.EDBClient` namespace. -3. Pass the name of the stored procedure to the instance of the `EDBCommand`. -4. Change the `EDBCommand.CommandType` to `CommandType.StoredProcedure`. -5. `Prepare()` the command. -6. Execute the command. - -## Example: Executing a stored procedure without parameters - -This sample procedure prints the name of department 10. The procedure takes no parameters and returns no parameters. To create the sample procedure, invoke EDB-PSQL and connect to the EDB Postgres Advanced Server host database. Enter the following SPL code at the command line: - -```Text -CREATE OR REPLACE PROCEDURE list_dept10 -IS - v_deptname VARCHAR2(30); -BEGIN - DBMS_OUTPUT.PUT_LINE('Dept No: 10'); - SELECT dname INTO v_deptname FROM dept WHERE deptno = 10; - DBMS_OUTPUT.PUT_LINE('Dept Name: ' || v_deptname); -END; -``` - -When EDB Postgres Advanced Server has validated the stored procedure, it echoes `CREATE PROCEDURE`. - -### Using the EDBCommand object to execute a stored procedure - -The `CommandType` property of the `EDBCommand` object indicates the type of command being executed. The `CommandType` property is set to one of three possible `CommandType` enumeration values: - -- Use the default `Text` value when passing a SQL string for execution. -- Use the `StoredProcedure` value, passing the name of a stored procedure for execution. -- Use the `TableDirect` value when passing a table name. This value passes back all records in the specified table. - -The `CommandText` property must contain a SQL string, stored procedure name, or table name, depending on the value of the `CommandType` property. - -The following example executes the stored procedure: - -```Text -<% @ Page Language="C#" Debug="true"%> -<% @Import Namespace="EnterpriseDB.EDBClient" %> -<% @Import Namespace="System.Data" %> -<% @Import Namespace="System.Configuration" %> - - -``` - -Save the sample code in a file named `storedProc.aspx` in a web root directory. - -To invoke the sample code, enter the following in a browser: `http://localhost/storedProc.aspx` - -## Example: Executing a stored procedure with IN parameters - -The following example shows calling a stored procedure that includes `IN` parameters. To create the sample procedure, invoke `EDB-PSQL` and connect to the EDB Postgres Advanced Server host database. Enter the following SPL code at the command line: - -```Text -CREATE OR REPLACE PROCEDURE - EMP_INSERT - ( - pENAME IN VARCHAR, - pJOB IN VARCHAR, - pSAL IN FLOAT4, - pCOMM IN FLOAT4, - pDEPTNO IN INTEGER, - pMgr IN INTEGER - ) -AS -DECLARE - CURSOR TESTCUR IS SELECT MAX(EMPNO) FROM EMP; - MAX_EMPNO INTEGER := 10; -BEGIN - - OPEN TESTCUR; - FETCH TESTCUR INTO MAX_EMPNO; - INSERT INTO EMP(EMPNO,ENAME,JOB,SAL,COMM,DEPTNO,MGR) - VALUES(MAX_EMPNO+1,pENAME,pJOB,pSAL,pCOMM,pDEPTNO,pMgr); - CLOSE testcur; -END; -``` - -When EDB Postgres Advanced Server has validated the stored procedure, it echoes `CREATE PROCEDURE`. - -### Passing input values to a stored procedure - -Calling a stored procedure that contains parameters is similar to executing a stored procedure without parameters. The major difference is that, when calling a parameterized stored procedure, you must use the `EDBParameter` collection of the `EDBCommand` object. When the `EDBParameter` is added to the `EDBCommand` collection, properties such as `ParameterName`, `DbType`, `Direction`, `Size`, and `Value` are set. - -The following example shows the process of executing a parameterized stored procedure from a C# script. - -```Text -<% @ Page Language="C#" Debug="true"%> -<% @Import Namespace="EnterpriseDB.EDBClient" %> -<% @Import Namespace="System.Data" %> -<% @Import Namespace="System.Configuration" %> - - - - -``` - -Save the sample code in a file named `storedProcInParam.aspx` in a web root directory. - -To invoke the sample code, enter the following in a browser: `http://localhost/storedProcInParam.aspx` - -In the example, the body of the `Page_Load` method declares and instantiates an `EDBConnection` object. The sample then creates an `EDBCommand` object with the properties needed to execute the stored procedure. - -The example then uses the `Add` method of the `EDBCommand Parameter` collection to add six input parameters. - -```text -EDBCommand cmdStoredProc = new EDBCommand -("emp_insert(:EmpName,:Job,:Salary,:Commission,:DeptNo,:Manager)",conn); -cmdStoredProc.CommandType = CommandType.StoredProcedure; -``` - -It assigns a value to each parameter before passing them to the `EMP_INSERT` stored procedure. - -The `Prepare()` method prepares the statement before calling the `ExecuteNonQuery()` method. - -The `ExecuteNonQuery` method of the `EDBCommand` object executes the stored procedure. After the stored procedure executes, a test record is inserted into the `emp` table, and the values inserted are displayed on the webpage. - -## Example: Executing a stored procedure with IN, OUT, and INOUT parameters - -The previous example demonstrated how to pass `IN` parameters to a stored procedure. The following examples show how to pass `IN` values and return `OUT` values from a stored procedure. - -### Creating the stored procedure - -The following stored procedure passes the department number and returns the corresponding location and department name. To create the sample procedure, open the EDB-PSQL command line, and connect to the EDB Postgres Advanced Server host database. Enter the following SPL code at the command line: - -```Text -CREATE OR REPLACE PROCEDURE - DEPT_SELECT - ( - pDEPTNO IN INTEGER, - pDNAME OUT VARCHAR, - pLOC OUT VARCHAR - ) -AS -DECLARE - CURSOR TESTCUR IS SELECT DNAME,LOC FROM DEPT; - REC RECORD; -BEGIN - - OPEN TESTCUR; - FETCH TESTCUR INTO REC; - - pDNAME := REC.DNAME; - pLOC := REC.LOC; - - CLOSE testcur; -END; -``` - -When EDB Postgres Advanced Server has validated the stored procedure, it echoes `CREATE PROCEDURE`. - -### Receiving output values from a stored procedure - -When retrieving values from `OUT` parameters, you must explicitly specify the direction of those parameters as `Output`. You can retrieve the values from `Output` parameters in two ways: - -- Call the `ExecuteReader` method of the `EDBCommand` and explicitly loop through the returned `EDBDataReader`, searching for the values of `OUT` parameters. -- Call the `ExecuteNonQuery` method of `EDBCommand` and explicitly get the value of a declared `Output` parameter by calling that `EDBParameter` value property. - -In each method, you must declare each parameter, indicating the direction of the parameter (`ParameterDirection.Input`, `ParameterDirection.Output`, or `ParameterDirection.InputOutput`). Before invoking the procedure, you must provide a value for each `IN` and `INOUT` parameter. After the procedure returns, you can retrieve the `OUT` and `INOUT` parameter values from the `command.Parameters[]` array. - -The following code shows using the `ExecuteReader` method to retrieve a result set: - -```Text -<% @ Page Language="C#" Debug="true"%> -<% @Import Namespace="EnterpriseDB.EDBClient" %> -<% @Import Namespace="System.Data" %> -<% @Import Namespace="System.Configuration" %> - - -``` - -The following code shows using the `ExecuteNonQuery` method to retrieve a result set: - -```Text -<% @ Page Language="C#" Debug="true"%> -<% @Import Namespace="EnterpriseDB.EDBClient" %> -<% @Import Namespace="System.Data" %> -<% @Import Namespace="System.Configuration" %> - - -``` diff --git a/product_docs/docs/net_connector/6.0.2.1/12_using_advanced_queueing.mdx b/product_docs/docs/net_connector/6.0.2.1/12_using_advanced_queueing.mdx deleted file mode 100644 index b234b682435..00000000000 --- a/product_docs/docs/net_connector/6.0.2.1/12_using_advanced_queueing.mdx +++ /dev/null @@ -1,490 +0,0 @@ ---- -title: "Using advanced queueing" - ---- - - - -EDB Postgres Advanced Server advanced queueing provides message queueing and message processing for the EDB Postgres Advanced Server database. User-defined messages are stored in a queue. A collection of queues is stored in a queue table. Create a queue table before creating a queue that depends on it. - -On the server side, procedures in the `DBMS_AQADM` package create and manage message queues and queue tables. Use the `DBMS_AQ` package to add or remove messages from a queue or register or unregister a PL/SQL callback procedure. For more information about `DBMS_AQ` and `DBMS_AQADM`, see [DBMS_AQ](/epas/latest/reference/oracle_compatibility_reference/epas_compat_bip_guide/03_built-in_packages/02_dbms_aq/). - -On the client side, the application uses the EDB.NET driver to enqueue and dequeue messages. - -## Enqueueing or dequeueing a message - -For more information about using EDB Postgres Advanced Server's advanced queueing functionality, see the [Database Compatibility for Oracle Developers Built-in Package Guide](/epas/latest/reference/oracle_compatibility_reference/epas_compat_bip_guide/). - -### Server-side setup - -To use advanced queueing functionality on your .NET application, you must first create a user-defined type, queue table, and queue, and then start the queue on the database server. Invoke EDB-PSQL and connect to the EDB Postgres Advanced Server host database. Use the following SPL commands at the command line: - -**Creating a user-defined type** - -To specify a RAW data type, create a user-defined type. The following example shows creating a user-defined type named as `myxml`. - -`CREATE TYPE myxml AS (value XML)`; - -**Creating the queue table** - -A queue table can hold multiple queues with the same payload type. The following example shows creating a table named `MSG_QUEUE_TABLE`. - -```Text -EXEC DBMS_AQADM.CREATE_QUEUE_TABLE - (queue_table => 'MSG_QUEUE_TABLE', - queue_payload_type => 'myxml', - comment => 'Message queue table'); -END; -``` - -**Creating the queue** - -The following example shows creating a queue named `MSG_QUEUE` in the table `MSG_QUEUE_TABLE`. - -```Text -BEGIN -DBMS_AQADM.CREATE_QUEUE ( queue_name => 'MSG_QUEUE', queue_table => 'MSG_QUEUE_TABLE', comment => 'This queue contains pending messages.'); -END; -``` - -**Starting the queue** - -Once the queue is created, invoke the following SPL code at the command line to start a queue in the EDB database. - -```Text -BEGIN -DBMS_AQADM.START_QUEUE -(queue_name => 'MSG_QUEUE'); -END; -``` - -### Client-side example - -Once you've created a user-defined type, followed by queue table and queue, start the queue. Then, you can enqueue or dequeue a message using EDB .Net drivers. - -**Enqueue a message** - -To enqueue a message on your .NET application, you must: - -1. Import the `EnterpriseDB.EDBClient` namespace. -2. Pass the name of the queue and create the instance of the `EDBAQQueue`. -3. Create the enqueue message and define a payload. -4. Call the `queue.Enqueue` method. - -The following code shows using the `queue.Enqueue` method: - -!!! Note - The following code creates the message and serializes it. This is just an example code and won't compile if copied as it is. You must serialize the message as XML. - -```Text -using EnterpriseDB.EDBClient; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace AQXml -{ - class MyXML - { - public string value { get; set; } - } - class Program - { - static void Main(string[] args) - { - int messagesToSend = 1; - if (args.Length > 0 && !string.IsNullOrEmpty(args[0])) - { - messagesToSend = int.Parse(args[0]); - } - for (int i = 0; i < 5; i++) - { - EnqueMsg("test message: " + i); - } - } - - private static EDBConnection GetConnection() - { - string connectionString = "Server=127.0.0.1;Host=127.0.0.1;Port=5444;User Id=enterprisedb;Password=test;Database=edb;Timeout=999"; - EDBConnection connection = new EDBConnection(connectionString); - connection.Open(); - return connection; - } - - - private static string ByteArrayToString(byte[] byteArray) - { - // Sanity check if it's null so we don't incur overhead of an exception - if (byteArray == null) - { - return string.Empty; - } - try - { - StringBuilder hex = new StringBuilder(byteArray.Length * 2); - foreach (byte b in byteArray) - { - hex.AppendFormat("{0:x2}", b); - } - - return hex.ToString().ToUpper(); - } - catch - { - return string.Empty; - } - } - - private static bool EnqueMsg(string msg) - { - EDBConnection con = GetConnection(); - using (EDBAQQueue queue = new EDBAQQueue("MSG_QUEUE", con)) - { - queue.MessageType = EDBAQMessageType.Xml; - EDBTransaction txn = queue.Connection.BeginTransaction(); - QueuedEntities.Message queuedMessage = new QueuedEntities.Message() { MessageText = msg }; - - try - { - string rootElementName = queuedMessage.GetType().Name; - if (rootElementName.IndexOf(".") != -1) - { - rootElementName = rootElementName.Split('.').Last(); - } - - string xml = new Utils.XmlFragmentSerializer().Serialize(queuedMessage); - EDBAQMessage queMsg = new EDBAQMessage(); - queMsg.Payload = new MyXML { value = xml }; - queue.MessageType = EDBAQMessageType.Udt; - queue.UdtTypeName = "myxml"; - EDBConnection.GlobalTypeMapper.MapComposite("myxml"); - con.ReloadTypes(); - queue.Enqueue(queMsg); - var messageId = ByteArrayToString((byte[])queMsg.MessageId); - Console.WriteLine("MessageID: " + messageId); - txn.Commit(); - queMsg = null; - xml = null; - rootElementName = null; - return true; - } - catch (Exception ex) - { - txn?.Rollback(); - Console.WriteLine("Failed to enqueue message."); - Console.WriteLine(ex.ToString()); - return false; - } - finally - { - queue?.Connection?.Dispose(); - } - } - } - - } -} -``` - -**Dequeueing a message** - -To dequeue a message on your .NET application, you must: - -1. Import the `EnterpriseDB.EDBClient` namespace. -2. Pass the name of the queue and create the instance of the `EDBAQQueue`. -3. Call the `queue.Dequeue` method. - -!!! Note - The following code creates the message and serializes it. This is just an example code and won't compile if copied as it is. You must serialize the message as XML. - -```Text -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using EnterpriseDB.EDBClient; - -namespace DequeueXML -{ - class MyXML - { - public string value { get; set; } - } - class Program - { - static void Main(string[] args) - { - DequeMsg(); - } - - - private static EDBConnection GetConnection() - { - string connectionString = "Server=127.0.0.1;Host=127.0.0.1;Port=5444;User Id=enterprisedb;Password=test;Database=edb;Timeout=999"; - EDBConnection connection = new EDBConnection(connectionString); - connection.Open(); - return connection; - } - - - private static string ByteArrayToString(byte[] byteArray) - { - // Sanity check if it's null so we don't incur overhead of an exception - if (byteArray == null) - { - return string.Empty; - } - try - { - StringBuilder hex = new StringBuilder(byteArray.Length * 2); - foreach (byte b in byteArray) - { - hex.AppendFormat("{0:x2}", b); - } - - return hex.ToString().ToUpper(); - } - catch - { - return string.Empty; - } - } - public static void DequeMsg(int waitTime = 10) - { - EDBConnection con = GetConnection(); - using (EDBAQQueue queueListen = new EDBAQQueue("MSG_QUEUE", con)) - { - queueListen.UdtTypeName = "myxml"; - queueListen.DequeueOptions.Navigation = EDBAQNavigationMode.FIRST_MESSAGE; - queueListen.DequeueOptions.Visibility = EDBAQVisibility.ON_COMMIT; - queueListen.DequeueOptions.Wait = 1; - EDBTransaction txn = null; - - while (1 == 1) - { - - if (queueListen.Connection.State == System.Data.ConnectionState.Closed) - { - queueListen.Connection.Open(); - } - - string messageId = "Unknown"; - try - { - // the listen function is a blocking function. It will Wait the specified waitTime or until a - // message is received. - Console.WriteLine("Listening..."); - string v = queueListen.Listen(null, waitTime); - // If we are waiting for a message and we specify a Wait time, - // then if there are no more messages, we want to just bounce out. - if (waitTime > -1 && v == null) - { - Console.WriteLine("No message received during Wait period."); - Console.WriteLine(); - continue; - } - - // once we're here that means a message has been detected in the queue. Let's deal with it. - txn = queueListen.Connection.BeginTransaction(); - - Console.WriteLine("Attempting to dequeue message..."); - // dequeue the message - EDBAQMessage deqMsg; - try - { - deqMsg = queueListen.Dequeue(); - } - catch (Exception ex) - { - if (ex.Message.Contains("ORA-25228")) - { - Console.WriteLine("Message was not there. Another process must have picked it up."); - Console.WriteLine(); - txn.Rollback(); - continue; - } - else - { - throw; - } - } - - messageId = ByteArrayToString((byte[])deqMsg.MessageId); - if (deqMsg != null) - { - Console.WriteLine("Processing received message..."); - // process the message payload - MyXML obj = (MyXML) deqMsg.Payload; - - QueuedEntities.Message msg = new Utils.XmlFragmentSerializer().Deserialize(obj.value); - - Console.WriteLine("Received Message:"); - Console.WriteLine("MessageID: " + messageId); - Console.WriteLine("Message: " + msg.MessageText); - Console.WriteLine("Enqueue Time" + queueListen.MessageProperties.EnqueueTime); - - txn.Commit(); - - Console.WriteLine("Finished processing message"); - Console.WriteLine(); - - } - else - { - Console.WriteLine("Message was not dequeued."); - } - } - catch (Exception ex) - { - Console.WriteLine("Failed To dequeue or process the dequeued message."); - Console.WriteLine(ex.ToString()); - Console.WriteLine(); - if (txn != null) - { - txn.Rollback(); - if (txn != null) - { - txn.Dispose(); - } - } - } - } - } - - } - } -} -``` - -## EDBAQ classes - -The following EDBAQ classes are used in this application: - -**EDBAQDequeueMode** - -The `EDBAQDequeueMode` class lists all the dequeuer modes available. - -| Value | Description | -| ------------- | ------------------------------------------------------------- | -| Browse | Reads the message without locking. | -| Locked | Reads and gets a write lock on the message. | -| Remove | Deletes the message after reading. This is the default value. | -| Remove_NoData | Confirms receipt of the message. | - -**EDBAQDequeueOptions** - -The `EDBAQDequeueOptions` class lists the options available when dequeuing a message. - -| Property | Description | -| -------------- | ------------------------------------------------------------------------------------------------------------------------------ | -| ConsumerName | The name of the consumer for which to dequeue the message. | -| DequeueMode | This is set from `EDBAQDequeueMode`. It represents the locking behavior linked with the dequeue option. | -| Navigation | This is set from `EDBAQNavigationMode`. It represents the position of the message to fetch. | -| Visibility | This is set from `EDBAQVisibility`. It represents whether the new message is dequeued as part of the current transaction. | -| Wait | The wait time for a message as per the search criteria. | -| Msgid | The message identifier. | -| Correlation | The correlation identifier. | -| DeqCondition | The dequeuer condition. It is a Boolean expression. | -| Transformation | The transformation to apply before dequeuing the message. | -| DeliveryMode | The delivery mode of the dequeued message. | - -**EDBAQEnqueueOptions** - -The `EDBAQEnqueueOptions` class lists the options available when enqueuing a message. - -| Property | Description | -| ----------------- | ------------------------------------------------------------------------------------------------------------------------------ | -| Visibility | This is set from `EDBAQVisibility`. It represents whether the new message is enqueued as part of the current transaction. | -| RelativeMsgid | The relative message identifier. | -| SequenceDeviation | The sequence when to dequeue the message. | -| Transformation | The transformation to apply before enqueuing the message. | -| DeliveryMode | The delivery mode of the enqueued message. | - -**EDBAQMessage** - -The `EDBAQMessage` class lists a message to enqueue/dequeue. - -| Property | Description | -| ------------ | -------------------------------- | -| Payload | The actual message to be queued. | -| MessageId | The ID of the queued message. | - -**EDBAQMessageProperties** - -The `EDBAQMessageProperties` lists the message properties available. - -| Property | Description | -| ---------------- | --------------------------------------------------------------------------------------------- | -| Priority | The priority of the message. | -| Delay | The duration post which the message is available for dequeuing, in seconds. | -| Expiration | The duration for which the message is available for dequeuing, in seconds. | -| Correlation | The correlation identifier. | -| Attempts | The number of attempts taken to dequeue the message. | -| RecipientList | The recipients list that overthrows the default queue subscribers. | -| ExceptionQueue | The name of the queue to move the unprocessed messages to. | -| EnqueueTime | The time when the message was enqueued. | -| State | The state of the message while dequeued. | -| OriginalMsgid | The message identifier in the last queue. | -| TransactionGroup | The transaction group for the dequeued messages. | -| DeliveryMode | The delivery mode of the dequeued message. | - -**EDBAQMessageState** - -The `EDBAQMessageState` class represents the state of the message during dequeue. - -| Value | Description | -| --------- | --------------------------------------------------------- | -| Expired | The message is moved to the exception queue. | -| Processed | The message is processed and kept. | -| Ready | The message is ready to be processed. | -| Waiting | The message is in waiting state. The delay isn't reached. | - -**EDBAQMessageType** - -The `EDBAQMessageType` class represents the types for payload. - -| Value | Description | -| --------- | ------------------------------------------------------------------------------------- | -| Raw | The raw message type.

Note: Currently, this payload type isn't supported. | -| UDT | The user defined type message. | -| XML | The XML type message.

Note: Currently, this payload type isn't supported. | - -**EDBAQNavigationMode** - -The `EDBAQNavigationMode` class represents the different types of navigation modes available. - -| Value | Description | -| ---------------- | ------------------------------------------------------------------ | -| First_Message | Returns the first available message that matches the search terms. | -| Next_Message | Returns the next available message that matches the search items. | -| Next_Transaction | Returns the first message of next transaction group. | - -**EDBAQQueue** - -The `EDBAQQueue` class represents a SQL statement to execute `DMBS_AQ` functionality on a PostgreSQL database. - -| Property | Description | -| ----------------- | --------------------------------------------------------------------------------------------- | -| Connection | The connection to use | -| Name | The name of the queue | -| MessageType | The message type that's enqueued/dequeued from this queue, for example `EDBAQMessageType.Udt` | -| UdtTypeName | The user-defined type name of the message type | -| EnqueueOptions | The enqueue options to use | -| DequeuOptions | The dequeue options to use | -| MessageProperties | The message properties to use | - -**EDBAQVisibility** - -The `EDBAQVisibility` class represents the visibility options available. - -| Value | Description | -| --------- | ----------------------------------------------------------- | -| Immediate | The enqueue/dequeue isn't part of the ongoing transaction. | -| On_Commit | The enqueue/dequeue is part of the current transaction. | - -!!! Note - - To review the default options for these parameters, see [DBMS_AQ](../../epas/11/epas_compat_bip_guide/03_built-in_packages/02_dbms_aq/). - - EDB advanced queueing functionality uses user-defined types for calling enqueue/dequeue operations. `Server Compatibility Mode=NoTypeLoading` can't be used with advanced queueing because `NoTypeLoading` doesn't load any user-defined types. diff --git a/product_docs/docs/net_connector/6.0.2.1/13_using_a_ref_cursor_in_a_net_application.mdx b/product_docs/docs/net_connector/6.0.2.1/13_using_a_ref_cursor_in_a_net_application.mdx deleted file mode 100644 index 1c338bbe855..00000000000 --- a/product_docs/docs/net_connector/6.0.2.1/13_using_a_ref_cursor_in_a_net_application.mdx +++ /dev/null @@ -1,105 +0,0 @@ ---- -title: "Using a ref cursor in a .NET application" - ---- - - - -A `ref cursor` is a cursor variable that contains a pointer to a query result set. The result set is determined by executing the `OPEN FOR` statement using the cursor variable. A cursor variable isn't tied to a particular query like a static cursor. You can open the same cursor variable a number of times with the `OPEN FOR` statement containing different queries and each time. A new result set is created for that query and made available by way of the cursor variable. You can declare a cursor variable in two ways: - -- Use the `SYS_REFCURSOR` built-in data type to declare a weakly typed ref cursor. -- Define a strongly typed ref cursor that declares a variable of that type. - -`SYS_REFCURSOR` is a ref cursor type that allows any result set to be associated with it. This is known as a weakly typed ref cursor. The following example is a declaration of a weakly typed ref cursor: - - `name SYS_REFCURSOR`; - -Following is an example of a strongly typed ref cursor: - - `TYPE IS REF CURSOR RETURN emp%ROWTYPE`; - -## Creating the stored procedure - -The following sample code creates a stored procedure called `refcur_inout_callee`. It specifies the data type of the ref cursor being passed as an OUT parameter. To create the sample procedure, invoke EDB-PSQL and connect to the EDB Postgres Advanced Server host database. Enter the following SPL code at the command line: - -```Text -CREATE OR REPLACE PROCEDURE - refcur_inout_callee(v_refcur OUT SYS_REFCURSOR) -IS -BEGIN - OPEN v_refcur FOR SELECT ename FROM emp; -END; -``` - -The following C# code uses the stored procedure to retrieve employee names from the `emp` table: - -```Text -using System; -using System.Data; -using EnterpriseDB.EDBClient; -using System.Configuration; - -namespace EDBRefCursor -{ - class EmpRefcursor - { - [STAThread] - static void Main(string[] args) - { - string strConnectionString = - ConfigurationManager.AppSettings["DB_CONN_STRING"]; - EDBConnection conn = new EDBConnection(strConnectionString); - conn.Open(); - try - { - EDBTransaction tran = conn.BeginTransaction(); - EDBCommand command = new EDBCommand("refcur_inout_callee", - conn); - command.CommandType = CommandType.StoredProcedure; - command.Transaction = tran; - command.Parameters.Add(new EDBParameter("refCursor", - EDBTypes.EDBDbType.Refcursor, 10, "refCursor", - - ParameterDirection.Output, false, 2, 2, - System.Data.DataRowVersion.Current, null)); - - command.Prepare(); - command.Parameters[0].Value = null; - - command.ExecuteNonQuery(); - String cursorName = command.Parameters[0].Value.ToString(); - command.CommandText = "fetch all in \"" + cursorName + "\""; - command.CommandType = CommandType.Text; - - EDBDataReader reader = - command.ExecuteReader(CommandBehavior.SequentialAccess); - int fc = reader.FieldCount; - while (reader.Read()) - { - for (int i = 0; i < fc; i++) - { - Console.WriteLine(reader.GetString(i)); - } - } - reader.Close(); - tran.Commit(); - } - catch (Exception ex) - { - Console.WriteLine(ex.Message.ToString()); - } - } - } -} -``` - -The following .NET code snippet displays the result on the console: - -```Text -for(int i = 0;i < fc; i++) -{ - Console.WriteLine(reader.GetString(i)); -} -``` - -You must bind the `EDBDbType.RefCursor` type in `EDBParameter()` if you're using a ref cursor parameter. diff --git a/product_docs/docs/net_connector/6.0.2.1/14_using_plugins.mdx b/product_docs/docs/net_connector/6.0.2.1/14_using_plugins.mdx deleted file mode 100644 index 90dbd406cf9..00000000000 --- a/product_docs/docs/net_connector/6.0.2.1/14_using_plugins.mdx +++ /dev/null @@ -1,64 +0,0 @@ ---- -title: "Using plugins" - ---- - - - -EDB .Net driver plugins support the enhanced capabilities for different data types that are otherwise not available in .Net. The different plugins available support: - -- GeoJSON -- Json.NET -- NetTopologySuite -- NodaTime - -The plugins support the use of spatial, data/time, and JSON types. The following are the supported frameworks and data provider installation path for these plugins. - -## GeoJSON - -If you're using the GeoJSON plugin on .NET Standard 2.0, the data provider installation path is: - - `C:\Program Files\edb\dotnet\plugins\GeoJSON\netstandard2.0` - -The following shared library files are required: - -`EnterpriseDB.EDBClient.GeoJSON.dll` - -For detailed information about using the GeoJSON plugin, see the [Npgsql documentation](http://www.npgsql.org/doc/types/geojson.html). - -## Json.NET - -If you're using the Json.NET plugin on .NET Standard 2.0, the data provider installation path is: - - `C:\Program Files\edb\dotnet\plugins\Json.NET\netstandard2.0` - -The following shared library files are required: - -`EnterpriseDB.EDBClient.Json.NET.dll` - -For detailed information about using the Json.NET plugin, see the [Npgsql documentation](http://www.npgsql.org/doc/types/jsonnet.html). - -## NetTopologySuite - -If you're using the NetTopologySuite plugin on .Net Standard 2.0, the data provider installation path is: - - `C:\Program Files\edb\dotnet\plugins\NetTopologySuite\netstandard2.0` - -The following shared library files are required: - - `EnterpriseDB.EDBClient.NetTopologySuite.dll` - -For detailed information about using the NetTopologySuite type plugin, see the [Npgsql documentation](http://www.npgsql.org/doc/types/nts.html). - -## NodaTime - -If you're using the NodaTime plugin on .Net Standard 2.0, the data provider installation path is: - - `C:\Program Files\edb\dotnet\plugins\NodaTime\netstandard2.0` - -The following shared library files are required: - - `EnterpriseDB.EDBClient.NodaTime.dll` - -For detailed information about using the NodaTime plugin, see the [Npgsql documentation](http://www.npgsql.org/doc/types/nodatime.html). - diff --git a/product_docs/docs/net_connector/6.0.2.1/15_using_object_types.mdx b/product_docs/docs/net_connector/6.0.2.1/15_using_object_types.mdx deleted file mode 100644 index 909897b0e27..00000000000 --- a/product_docs/docs/net_connector/6.0.2.1/15_using_object_types.mdx +++ /dev/null @@ -1,185 +0,0 @@ ---- -title: "Using object types in .NET" - ---- - - - -The SQL `CREATE TYPE` command creates a user-defined object type, which is stored in the EDB Postgres Advanced Server database. - -You can then reference these user-defined types in SPL procedures, SPL functions, and .NET programs. - -The basic object type is created with the `CREATE TYPE AS OBJECT` command with optional use of the `CREATE TYPE BODY` command. - -## Using an object type - -To use an object type, you must first create the object type in the EDB Postgres Advanced Server database. Object type `addr_object_type` defines the attributes of an address: - -```text -CREATE OR REPLACE TYPE addr_object_type AS OBJECT -( - street VARCHAR2(30), - city VARCHAR2(20), - state CHAR(2), - zip NUMBER(5) -); -``` - -Object type `emp_obj_typ` defines the attributes of an employee. One of these attributes is object type `ADDR_OBJECT_TYPE`, as previously described. The object type body contains a method that displays the employee information: - -```text -CREATE OR REPLACE TYPE emp_obj_typ AS OBJECT -( - empno NUMBER(4), - ename VARCHAR2(20), - addr ADDR_OBJECT_TYPE, - MEMBER PROCEDURE display_emp(SELF IN OUT emp_obj_typ) -); - -CREATE OR REPLACE TYPE BODY emp_obj_typ AS - MEMBER PROCEDURE display_emp (SELF IN OUT emp_obj_typ) - IS - BEGIN - DBMS_OUTPUT.PUT_LINE('Employee No : ' || SELF.empno); - DBMS_OUTPUT.PUT_LINE('Name : ' || SELF.ename); - DBMS_OUTPUT.PUT_LINE('Street : ' || SELF.addr.street); - DBMS_OUTPUT.PUT_LINE('City/State/Zip: ' || SELF.addr.city || ', ' || - SELF.addr.state || ' ' || LPAD(SELF.addr.zip,5,'0')); - END; -END; -``` - -The following listing is a complete .NET program that uses these user-defined object types: - -```text -namespace ObjectTypesSample -{ - class Program - { - static void Main(string[] args) - { - EDBConnection.GlobalTypeMapper.MapComposite("enterprisedb.addr_object_type"); - EDBConnection.GlobalTypeMapper.MapComposite("enterprisedb.emp_obj_typ"); - EDBConnection conn = new EDBConnection("Server=localhost;Port=5444;database=test;User ID=enterprisedb;password=;"); - - try - { - conn.Open(); - - EDBCommand cmd = new EDBCommand("emp_obj_typ.display_emp", conn); - - cmd.CommandType = System.Data.CommandType.StoredProcedure; - EDBCommandBuilder.DeriveParameters(cmd); - - addr_object_type address = new addr_object_type() - { - street = "123 MAIN STREET", - city = "EDISON", - state = "NJ", - zip = 8817 - }; - - emp_obj_typ emp = new emp_obj_typ() - { - empno = 9001, - ename = "JONES", - addr = address - }; - cmd.Parameters[0].Value = emp; - cmd.Prepare(); - cmd.ExecuteNonQuery(); - - emp_obj_typ empOut = (emp_obj_typ)cmd.Parameters[0].Value; - Console.WriteLine("Emp No: " + empOut.empno); - Console.WriteLine("Emp Name: " + empOut.ename); - Console.WriteLine("Emp Address Street: " + empOut.addr.street); - Console.WriteLine("Emp Address City: " + empOut.addr.city); - Console.WriteLine("Emp Address State: " + empOut.addr.state); - Console.WriteLine("Emp Address Zip: " + empOut.addr.zip); - Console.WriteLine("Emp No: " + empOut.empno); - } - catch (EDBException exp) - { - Console.WriteLine(exp.Message.ToString()); - } - finally - { - conn.Close(); - } - } - } - - public class addr_object_type - { - public string street; - public string city; - public string state; - public decimal zip; - } - - public class emp_obj_typ - { - public decimal empno; - public string ename; - public addr_object_type addr; - } -} -``` - -The following .NET types are defined to map to the types in EDB Postgres Advanced Server: - -```text -public class addr_object_type -{ - public string street; - public string city; - public string state; - public decimal zip; -} - -public class emp_obj_typ -{ - public decimal empno; - public string ename; - public addr_object_type addr; -} -``` - -A call to `EDBConnection.GlobalTypeMapper.MapComposite` maps the .NET type to the EDB Postgres Advanced Server types: - -```text -EDBConnection.GlobalTypeMapper.MapComposite("enterprisedb.addr_object_type"); - EDBConnection.GlobalTypeMapper.MapComposite("enterprisedb.emp_obj_typ"); -``` - -A call to `EDBCommandBuilder.DeriveParameters()` gets parameter information for a stored procedure. This allows you to just set the parameter values and call the stored procedure: - -```text -EDBCommandBuilder.DeriveParameters(cmd); -``` - -The value of the parameter is set by creating an object of the .NET type and assigning it to the `Value` property of the parameter: - -```text -addr_object_type address = new addr_object_type() -{ - street = "123 MAIN STREET", - city = "EDISON", - state = "NJ", - zip = 8817 -}; - -emp_obj_typ emp = new emp_obj_typ() -{ - empno = 9001, - ename = "JONES", - addr = address -}; -cmd.Parameters[0].Value = emp; -``` - -A call to `cmd.ExecuteNonQuery()` executes the call to the `display_emp()` method: - -```text -cmd.ExecuteNonQuery(); -``` diff --git a/product_docs/docs/net_connector/6.0.2.1/16_scram_compatibility.mdx b/product_docs/docs/net_connector/6.0.2.1/16_scram_compatibility.mdx deleted file mode 100644 index 886739de0ae..00000000000 --- a/product_docs/docs/net_connector/6.0.2.1/16_scram_compatibility.mdx +++ /dev/null @@ -1,10 +0,0 @@ ---- -title: "Scram compatibility" -legacyRedirects: - - "/edb-docs/d/edb-postgres-net-connector/user-guides/net-guide/4.1.6.1/security_and_encryption.html" - ---- - - - -The EDB .NET driver provides SCRAM-SHA-256 support for EDB Postgres Advanced Server version 10 and above. This support is available from EDB .NET 4.0.2.1 release onwards. diff --git a/product_docs/docs/net_connector/6.0.2.1/17_advanced_server_net_connector_logging.mdx b/product_docs/docs/net_connector/6.0.2.1/17_advanced_server_net_connector_logging.mdx deleted file mode 100644 index 90c8a7c7122..00000000000 --- a/product_docs/docs/net_connector/6.0.2.1/17_advanced_server_net_connector_logging.mdx +++ /dev/null @@ -1,104 +0,0 @@ ---- -title: "EDB .NET Connector logging" - ---- - - - -EDB .NET Connector supports the use of logging to help resolve issues with the .NET Connector when used in your application. The connector uses classes in the `EnterpriseDB.EDBClient.Logging` namespace for logging. - -## Console logging to standard error - -`EnterpriseDB.EDBClient.Logging.ConsoleLoggingProvider` is a class that outputs error messages to `STDERR`. To use this class, include the following line in your application before using any of the EDB Postgres Advanced Server .NET Connector APIs. - -`EnterpriseDB.EDBClient.Logging.EDBLogManager.Provider = new EnterpriseDB.EDBClient.Logging.ConsoleLoggingProvider(EDBLogLevel.Debug, true, true);` - -The following log levels are available: - -- Trace -- Debug -- Info -- Warn -- Error -- Fatal - -## Writing a custom logger - -If the console logging provider doesn't meet your needs, you can write a custom logger by implementing the `EnterpriseDB.EDBClient.Logging.IEDBLoggingProvider` interface and extending the `EnterpriseDB.EDBClient.Logging.EDBLogger` class, for instance, writing your logs to a file. The following is a simple example of how to write a custom logger: - -```text -public class MyLoggingProvider : IEDBLoggingProvider - { - string _logFile; - readonly EDBLogLevel _minLevel; - readonly bool _printLevel; - readonly bool _printConnectorId; - - public MyLoggingProvider(string logFile, EDBLogLevel minLevel = EDBLogLevel.Info, bool printLevel = false, bool printConnectorId = false) - { - _logFile = logFile; - _minLevel = minLevel; - _printLevel = printLevel; - _printConnectorId = printConnectorId; - } - - public EDBLogger CreateLogger(string name) - { - return new MyLogger(_logFile, _minLevel, _printLevel, _printConnectorId); - } - } - - class MyLogger : EDBLogger - { - string _logFile; - readonly EDBLogLevel _minLevel; - readonly bool _printLevel; - readonly bool _printConnectorId; - - internal MyLogger(string logFile, EDBLogLevel minLevel, bool printLevel, bool printConnectorId) - { - _logFile = logFile; - _minLevel = minLevel; - _printLevel = printLevel; - _printConnectorId = printConnectorId; - } - - public override bool IsEnabled(EDBLogLevel level) => level >= _minLevel; - - public override void Log(EDBLogLevel level, int connectorId, string msg, Exception exception = null) - { - if (!IsEnabled(level)) - return; - - - using (StreamWriter writer = new StreamWriter(_logFile, true)) - { - var sb = new StringBuilder(); - if (_printLevel) - { - sb.Append(level.ToString().ToUpper()); - sb.Append(' '); - } - - if (_printConnectorId && connectorId != 0) - { - sb.Append("["); - sb.Append(connectorId); - sb.Append("] "); - } - - sb.AppendLine(msg); - - if (exception != null) - sb.AppendLine(exception.ToString()); - - writer.Write(sb.ToString()); - } - - } - } -``` - -To use this custom logger, put the following line in your application before using any of the EDB .NET Connector APIs: - -`EDBLogManager.Provider = new MyLoggingProvider(filepath, EDBLogLevel.Debug, true, true);` diff --git a/product_docs/docs/net_connector/6.0.2.1/18_api_reference.mdx b/product_docs/docs/net_connector/6.0.2.1/18_api_reference.mdx deleted file mode 100644 index 53050c37952..00000000000 --- a/product_docs/docs/net_connector/6.0.2.1/18_api_reference.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -title: "API reference" - ---- - - - -For information about using the API, see the [Npgsql documentation](http://www.npgsql.org/doc/api/Npgsql.html). - -Usage notes: - -- When using the API, replace references to `Npgsql` with `EnterpriseDB.EDBClient`. -- When referring to classes, replace `Npgsql` with `EDB`. For example, use the `EDBBinaryExporter` class instead of the `NpgsqlBinaryExporter` class. diff --git a/product_docs/docs/net_connector/6.0.2.1/images/connection_opened_successfully.png b/product_docs/docs/net_connector/6.0.2.1/images/connection_opened_successfully.png deleted file mode 100755 index bab12126d20..00000000000 --- a/product_docs/docs/net_connector/6.0.2.1/images/connection_opened_successfully.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:537e7edecce3882b794110e0ffc644a51cab69ba2c7e7f82a3e99d32c4b4ba65 -size 22683 diff --git a/product_docs/docs/net_connector/6.0.2.1/images/dialog.png b/product_docs/docs/net_connector/6.0.2.1/images/dialog.png deleted file mode 100755 index 19cba54d1f9..00000000000 --- a/product_docs/docs/net_connector/6.0.2.1/images/dialog.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:f922e6cd4e43927708b5f460f5389a5b3a41dd70f3a5394723e6aee7d710f1ae -size 9048 diff --git a/product_docs/docs/net_connector/6.0.2.1/images/dotnet_installation_complete.png b/product_docs/docs/net_connector/6.0.2.1/images/dotnet_installation_complete.png deleted file mode 100755 index 332ae795899..00000000000 --- a/product_docs/docs/net_connector/6.0.2.1/images/dotnet_installation_complete.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:0983f216ce071f57f7e758980c3f966caded4312412905a6aba66efa362fdb13 -size 272137 diff --git a/product_docs/docs/net_connector/6.0.2.1/images/dotnet_installation_dialog.png b/product_docs/docs/net_connector/6.0.2.1/images/dotnet_installation_dialog.png deleted file mode 100755 index b465d536032..00000000000 --- a/product_docs/docs/net_connector/6.0.2.1/images/dotnet_installation_dialog.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:994a725f061f1b51fd92ccc2df5abd9066a1cf4ea7600611ae57ebc6cc59af20 -size 51144 diff --git a/product_docs/docs/net_connector/6.0.2.1/images/dotnet_installation_wizard.png b/product_docs/docs/net_connector/6.0.2.1/images/dotnet_installation_wizard.png deleted file mode 100755 index 29c9a7f99f9..00000000000 --- a/product_docs/docs/net_connector/6.0.2.1/images/dotnet_installation_wizard.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:efe8029105db01662005a349a7b59c87b6f7dce3017990a197e3b9b681392860 -size 227235 diff --git a/product_docs/docs/net_connector/6.0.2.1/images/ready_to_install.png b/product_docs/docs/net_connector/6.0.2.1/images/ready_to_install.png deleted file mode 100755 index 59e44d96bc5..00000000000 --- a/product_docs/docs/net_connector/6.0.2.1/images/ready_to_install.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:91b18bef7b78a6dae7d6b664e2bccfbfdb4248dbd034cb59e2c6a35ada7da49c -size 44080 diff --git a/product_docs/docs/net_connector/6.0.2.1/images/selecting_the_connectors_installer.png b/product_docs/docs/net_connector/6.0.2.1/images/selecting_the_connectors_installer.png deleted file mode 100755 index 432e4473c09..00000000000 --- a/product_docs/docs/net_connector/6.0.2.1/images/selecting_the_connectors_installer.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:d939c7e6604025f82be47969d69e6acc63ab5a48a0af4341e42efe0156b42778 -size 97808 diff --git a/product_docs/docs/net_connector/6.0.2.1/images/starting_stackbuilder_plus.png b/product_docs/docs/net_connector/6.0.2.1/images/starting_stackbuilder_plus.png deleted file mode 100755 index 11665300652..00000000000 --- a/product_docs/docs/net_connector/6.0.2.1/images/starting_stackbuilder_plus.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:ce6bcefb865ca14239fb7e0e2ac5149ed56251cfbc5153869070d039f70857c6 -size 91989 diff --git a/product_docs/docs/net_connector/6.0.2.1/index.mdx b/product_docs/docs/net_connector/6.0.2.1/index.mdx deleted file mode 100644 index 0e336b58c12..00000000000 --- a/product_docs/docs/net_connector/6.0.2.1/index.mdx +++ /dev/null @@ -1,20 +0,0 @@ ---- -title: "EDB .NET Connector" -directoryDefaults: - description: "EDB .NET Connector Version 6.0.2.1 Documentation and release notes." -pdf: true ---- - -The EDB .NET Connector distributed with EDB Postgres Advanced Server provides connectivity between a .NET client application and an EDB Postgres Advanced Server database server. You can: - -- Connect to an instance of EDB Postgres Advanced Server. -- Retrieve information from an EDB Postgres Advanced Server database. -- Update information stored on an EDB Postgres Advanced Server database. - -To understand these examples, you need a solid working knowledge of C# and .NET. The EDB .NET Connector functionality is built on the core functionality of the Npgsql open source project. For details, see the [Npgsql User Guide](http://www.npgsql.org/doc/index.html). - -
- -release_notes requirements_overview the_advanced_server_net_connector_overview installing_and_configuring_the_net_connector using_the_net_connector opening_a_database_connection retrieving_database_records parameterized_queries inserting_records_in_a_database deleting_records_in_a_database using_spl_stored_procedures_in_your_net_application using_advanced_queueing using_a_ref_cursor_in_a_net_application using_plugins using_object_types scram_compatibility advanced_server_net_connector_logging api_reference conclusion - -
diff --git a/product_docs/docs/net_connector/7.0.4.1/02_requirements_overview.mdx b/product_docs/docs/net_connector/7.0.4.1/02_requirements_overview.mdx deleted file mode 100644 index c3ff057ce23..00000000000 --- a/product_docs/docs/net_connector/7.0.4.1/02_requirements_overview.mdx +++ /dev/null @@ -1,20 +0,0 @@ ---- -title: "Product compatibility" ---- - - - -These are the supported versions and platforms for the EDB .NET Connector. - -The EDB .NET Connector is certified with EDB Postgres Advanced Server version 11 and later. - -The EDB .NET Connector graphical installers are supported on the following Windows platforms: - -64-bit Windows: - -- Windows Server 2019 -- Windows 10 - -32-bit Windows: - -- Windows 10 diff --git a/product_docs/docs/net_connector/7.0.4.1/03_the_advanced_server_net_connector_overview.mdx b/product_docs/docs/net_connector/7.0.4.1/03_the_advanced_server_net_connector_overview.mdx deleted file mode 100644 index cd151de3e95..00000000000 --- a/product_docs/docs/net_connector/7.0.4.1/03_the_advanced_server_net_connector_overview.mdx +++ /dev/null @@ -1,41 +0,0 @@ ---- -title: "EDB .NET Connector overview" - ---- - - - -EDB .NET Connector is a .NET data provider that allows a client application to connect to a database stored on an EDB Postgres Advanced Server host. The .NET Connector accesses the data directly, allowing the client application optimal performance, a broad spectrum of functionality, and access to EDB Postgres Advanced Server features. - -The .NET Connector supports the following frameworks: - -- .NET 7.0 -- .NET 6.0 -- .NET 5.0 -- .NET Core 3.1 -- .NET Standard 2.0 and 2.1 - - -## The .NET class hierarchy - -The .NET class hierarchy contains classes that you can use to create objects that control a connection to the EDB Postgres Advanced Server database and manipulate the data stored on the server. The following are a few of the most commonly used object classes. - -`EDBDataSource` - - `EDBDataSource` is the entry point for all the connections made to the database. It's responsible for issuing connections to the server and efficiently managing them. Starting with EDB .NET Connector 7.0.4.1, you no longer need direct instantiation of `EDBConnection`. Instantiate `EDBDataSource` and use the method provided to create commands or execute queries. - -`EDBConnection` - - The `EDBConnection` class represents a connection to EDB Postgres Advanced Server. An `EDBConnection` object contains a `ConnectionString` that tells the .NET client how to connect to an EDB Postgres Advanced Server database. Obtain `EDBConnection` from an `EDBDataSource` instance, and use it directly only in specific scenarios, such as transactions. - -`EDBCommand` - - An `EDBCommand` object contains an SQL command that the client executes against EDB Postgres Advanced Server. Before you can execute an `EDBCommand` object, you must link it to an `EDBConnection` object. - -`EDBDataReader` - - An `EDBDataReader` object provides a way to read an EDB Postgres Advanced Server result set. You can use an `EDBDataReader` object to step through one row at a time, forward only. - -`EDBDataAdapter` - - An `EDBDataAdapter` object links a result set to the EDB Postgres Advanced Server database. You can modify values and use the `EDBDataAdapter` class to update the data stored in an EDB Postgres Advanced Server database. diff --git a/product_docs/docs/net_connector/7.0.4.1/04_installing_and_configuring_the_net_connector.mdx b/product_docs/docs/net_connector/7.0.4.1/04_installing_and_configuring_the_net_connector.mdx deleted file mode 100644 index 6256283cc01..00000000000 --- a/product_docs/docs/net_connector/7.0.4.1/04_installing_and_configuring_the_net_connector.mdx +++ /dev/null @@ -1,268 +0,0 @@ ---- -title: "Installing and configuring the .NET Connector" - ---- - - - -## Installing the .NET Connector - -You can use the EDB .NET Connector Installer (available [from the EDB website](https://www.enterprisedb.com/software-downloads-postgres)) to add the .NET Connector to your system. - -1. After downloading the installer, right-click the installer icon, and select **Run As Administrator** from the context menu. When prompted, select an installation language and select **OK** to continue to the Setup window. - - ![The .NET Connector Installation wizard](images/dotnet_installation_wizard.png) - -1. Select **Next**. - - ![The Installation dialog box](images/dotnet_installation_dialog.png) - -1. Use the Installation Directory dialog box to specify the directory in which to install the connector. Select **Next**. - - ![The Ready to Install dialog box](images/ready_to_install.png) - -1. To start the installation, on the Ready to Install dialog box, select **Next**. Popups confirm the progress of the installation wizard. - - ![The installation is complete](images/dotnet_installation_complete.png) - -1. When the wizard informs you that it has completed the setup, select **Finish**. - -You can also use StackBuilder Plus to add or update the connector on an existing Advanced Server installation. - -1. To open StackBuilder Plus, from the Windows **Apps** menu, select **StackBuilder Plus**. - - ![Starting StackBuilder Plus](images/starting_stackbuilder_plus.png) - -1. When StackBuilder Plus opens, follow the onscreen instructions. - -1. From the Database Drivers node of the tree control, select the **EnterpriseDB.Net Connector** option. - - ![Selecting the Connectors installer](images/selecting_the_connectors_installer.png) - -1. Follow the directions of the onscreen wizard to add or update an installation of an EDB Connector. - -## Configuring the .NET Connector - -For information about configuring the .NET Connector in each environment, see: - -- **Referencing the Library Files.** [General configuration information](#referencing_the_library_files) applicable to all components. -- **.NET 7.0** Instructions for configuring for use with [.NET 7.0](#setup_7_0) -- **.NET 6.0** Instructions for configuring for use with [.NET 6.0](#setup_6_0). -- **.NET 5.0** Instructions for configuring for use with [.NET 5.0](#setup_5_0). -- **.NET Core 3.1** Instructions for configuring for use with [.NET Core 3.1](#framework_setup_core3_1). -- **.NET Standard 2.0** Instructions for configuring for use with [.NET Standard 2.0](#standard_setup_2). -- **.NET Standard 2.1** Instructions for configuring for use with [.NET Standard 2.1](#standard_setup_2_1). -- **.NET EntityFramework Core** Instructions for configuring for use with [.NET EntityFramework Core](#entity_setup). - -### Referencing the library files - - - -To reference library files with Microsoft Visual Studio: - -1. Select the project in the Solution Explorer. -2. Select **Project > Add Reference**. -3. In the Add Reference` dialog box, browse to select the appropriate library files. - -Optionally, you can copy the library files to the specified location. - -Before you can use an EDB .NET class, you must import the namespace into your program. Importing a namespace makes the compiler aware of the classes available within the namespace. The namespace is `EnterpriseDB.EDBClient`. - -The method you use to include the namespace varies by the type of application you're writing. For example, the following command imports a namespace into an `ASP.NET` page: - -```text - <% import namespace="EnterpriseDB.EDBClient" %> -``` - -To import a namespace into a C# application, use: - -```text - using EnterpriseDB.EDBClient; -``` - -### .NET framework setup - -Each .NET version has specific setup instructions. - - - -#### .NET 7.0 - -For .NET 7.0, the data provider installation path is `C:\Program Files\edb\dotnet\net7.0\`. - -You must add the following dependencies to your project: - -- `EnterpriseDB.EDBClient.dll` - -Depending on your application type, you might need to import the namespace into the source code. See [Referencing the library files](#referencing_the_library_files) for this and the other information about referencing the library files. - - - -#### .NET 6.0 - -For .NET 6.0, the data provider installation path is: - - `C:\Program Files\edb\dotnet\net6.0\` - -You must add the following dependencies to your project: - -- `EnterpriseDB.EDBClient.dll` - -Depending on your application type, you might need to import the namespace into the source code. See [Referencing the library files](#referencing_the_library_files) for this and the other information about referencing library files. - - - -#### .NET 5.0 - -For .NET 5.0, the data provider installation path is `C:\Program Files\edb\dotnet\net5.0\`. - -You must add the following dependencies to your project: - -- `EnterpriseDB.EDBClient.dll` - -Depending on your application type, you might need to import the namespace into the source code. See [Referencing the library files](#referencing_the_library_files) for this and the other information about referencing the library files. - - - -#### .NET Core 3.1 - -For .NET Core 3.1, the data provider installation path is `C:\Program Files\edb\dotnet\netcoreapp3.1\`. - -The following shared library files are required: - -- `EnterpriseDB.EDBClient.dll` - -- `System.Threading.Tasks.Extensions.dll` - -- `System.Runtime.CompilerServices.Unsafe.dll` - -- `System.ValueTuple.dll` - -- `System.Memory.dll` - -Depending on your application type, you might need to import the namespace into the source code. See [Referencing the library files](#referencing_the_library_files) for this and the other information about referencing the library files. - - - -#### .NET Standard 2.0 - -For .NET Standard Framework 2.0, the data provider installation path is `C:\Program Files\edb\dotnet\netstandard2.0\`. - -You must add the following dependencies to your project: - -- `EnterpriseDB.EDBClient.dll` - -- `System.Threading.Tasks.Extensions.dll` - -- `System.Runtime.CompilerServices.Unsafe.dll` - -- `System.ValueTuple.dll` - -!!! Note - If your target framework is .Net Core 2.0, then include the file `System.Threading.Tasks.Extensions.dll` in your project. - -Depending on your application type, you might need to import the namespace into the source code. See [Referencing the library files](#referencing_the_library_files) for this and the other information about referencing the library files. - - - -#### .NET Standard 2.1 - -For .NET Standard Framework 2.1, the data provider installation path is `C:\Program Files\edb\dotnet\netstandard2.1\`. - -The following shared library files are required: - -- `EnterpriseDB.EDBClient.dll` - -- `System.Memory.dll` - -- `System.Runtime.CompilerServices.Unsafe.dll` - -- `System.Text.Json.dll` - -- `System.Threading.Tasks.Extensions.dll` - -- `System.ValueTuple.dll` - -Depending on your application type, you might need to import the namespace into the source code. See [Referencing the library files](#referencing_the_library_files) for this and the other information about referencing the library files. - - - -#### .NET Entity Framework Core - -To configure the .NET Connector for use with Entity Framework Core, the data provider installation path is either: - -- `C:\Program Files\edb\dotnet\EF.Core\EFCore.PG\net7.0` - -- `C:\Program Files\edb\dotnet\EF.Core\EFCore.PG\net6.0` - -The following shared library file is required: - -- `EnterpriseDB.EDBClient.EntityFrameworkCore.PostgreSQL.dll` - -!!! Note - - You can use Entity Framework Core with the `EnterpriseDB.EDBClient.dll` library available in the `net7.0` or `net6.0` subdirectory. - - -See [Referencing the library files](#referencing_the_library_files) for information about referencing the library files. - -The following NuGet packages are required: - -- `Microsoft.EntityFrameworkCore.Design` - -- `Microsoft.EntityFrameworkCore.Relational` - -- `Microsoft.EntityFrameworkCore.Abstractions` - - -For usage information about Entity Framework Core, see the [Microsoft documentation](https://learn.microsoft.com/en-us/ef/core/). - -**Prerequisite** - -To open a command prompt: - -Select **Tools > Command Line > Developer Command Prompt**. - -Install dotnet-ef (using the command prompt), - - `dotnet tool install --global dotnet-ef` - -**Sample project** - -Create a new Console Application based on .NET 7.0 or .NET 6.0.. - -Add Reference to the following EDB assemblies: - -- `EnterpriseDB.EDBClient.EntityFrameworkCore.PostgreSQL.dll` - -- `EnterpriseDB.EDBClient.dll` - -Add the following NuGet packages: - -- `Microsoft.EntityFrameworkCore.Design` - -- `Microsoft.EntityFrameworkCore.Relational` - -- `Microsoft.EntityFrameworkCore.Abstractions` - -**Database-first scenario** - -Issue the following command to create model classes corresponding to all objects in the specified database: - -```text -dotnet ef dbcontext scaffold Host=;Database=;Username=;Password=;Port= EnterpriseDB.EDBClient.EntityFrameworkCore.PostgreSQL -o Models -``` - -**Code-first scenario** - -Add code for defining a DbContext and create, read, update, and delete operations. - -For further details, see the Microsoft documentation. - -Issue the following commands to create the initial database and tables: - -```text - dotnet ef migrations add InitialCreate --context BloggingContext - - dotnet ef database update --context BloggingContext -``` diff --git a/product_docs/docs/net_connector/7.0.4.1/05_using_the_net_connector.mdx b/product_docs/docs/net_connector/7.0.4.1/05_using_the_net_connector.mdx deleted file mode 100644 index dcdac30a376..00000000000 --- a/product_docs/docs/net_connector/7.0.4.1/05_using_the_net_connector.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -title: "Using the .NET Connector" - ---- - - - -These examples show how you can use the EDB object classes that are provided by the EDB .NET Connector that allow a .NET application to connect to and interact with an EDB Postgres Advanced Server database. - -To use these examples, place the .NET library files in the same directory as the compiled form of your application. All of these examples are written in C#, and each is embedded in an ASP.NET page. The same logic and code applies to other .NET applications (WinForm or console applications, for example). - -Create and save the following `web.config` file in the same directory as the sample code. The examples make use of the `DB_CONN_STRING` key from this configuration file to return a connection string from the EDB Postgres Advanced Server host. - -```text - - - - - - -``` - -An EDB Postgres Advanced Server connection string for an ASP.NET web application is stored in the `web.config` file. If you're writing an application that doesn't use ASP.NET, provide the connection information in an application configuration file such as `app.config`. diff --git a/product_docs/docs/net_connector/7.0.4.1/06_opening_a_database_connection.mdx b/product_docs/docs/net_connector/7.0.4.1/06_opening_a_database_connection.mdx deleted file mode 100644 index 8f5eb142b23..00000000000 --- a/product_docs/docs/net_connector/7.0.4.1/06_opening_a_database_connection.mdx +++ /dev/null @@ -1,278 +0,0 @@ ---- -title: "Opening a database connection" - ---- - - - -An `EDBConnection` object is responsible for handling the communication between an instance of EDB Postgres Advanced Server and a .NET application. Before you can access data stored in an EDB Postgres Advanced Server database, you must create and open an `EDBConnection` object. - -## Creating an EDBConnection object - -You can open a connection using one of the following approaches. In either case, you must import the namespace `EnterpriseDB.EDBClient`. - -### Connection with a data source - -1. Create an instance of the `EDBDataSource` object using a connection string as a parameter to the create method of the `EDBDataSource` class. - -2. Call the `OpenConnection` method of the `EDBDataSource` object to open a connection. - -This example shows how to open a connection using a data source: - - ```text - await using var dataSource = EDBDataSource.Create(ConnectionString); - var connection = dataSource.OpenConnection(); - ``` - -### Connection without a data source - -1. Create an instance of the `EDBConnection` object using a connection string as a parameter to the constructor of the `EDBConnection` class. - -2. Call the `Open` method of the `EDBConnection` object to open the connection. - -This example shows how to open a connection without a data source: - - ```text - EDBConnection conn = new EDBConnection(ConnectionString); - conn.Open(); - ``` - -!!! Note - For `EnterpriseDB.EDBClient 7.0.4` and later, we recommend `EDBDataSource` to connect to EDB Postgres Advanced Server database or execute SQL directly against it. For more information on data source, see the [Npgsql documentation](https://www.npgsql.org/doc/basic-usage.html). - - - - -## Connection string parameters - -A valid connection string specifies location and authentication information for an EDB Postgres Advanced Server instance. You must provide the connection string before opening the connection. A connection string must contain: - -- The name or IP address of the server -- The name of the EDB Postgres Advanced Server database -- The name of an EDB Postgres Advanced Server user -- The password associated with that user - -You can include the following parameters in the connection string: - -`CommandTimeout` - - `CommandTimeout` specifies the length of time (in seconds) to wait for a command to finish executing before throwing an exception. The default value is `20`. - -`ConnectionLifeTime` - - Use `ConnectionLifeTime` to specify the length of time (in seconds) to wait before closing unused connections in the pool. The default value is `15`. - -`Database` - - Use the `Database` parameter to specify the name of the database for the application to connect to. The default is the name of the connecting user. - -`Encoding` - - The `Encoding` parameter is obsolete. The parameter always returns the string `unicode` and silently ignores attempts to set it. - -`Integrated Security` - - Specify a value of `true` to use Windows Integrated Security. By default, `Integrated Security` is set to `false`, and Windows Integrated Security is disabled. - -`Load Role Based Tables` - - Use `Load Role Based Tables` to load table OIDs based on role. This change affects only the loading of table type OID and not the composite type. Setting this parameter to `true` triggers the new functionality. The default value is `false`. - -`MaxPoolSize` - - `MaxPoolSize` instructs `EDBConnection` to dispose of pooled connections when the pool exceeds the specified number of connections. The default value is `20`. - -`MinPoolSize` - - `MinPoolSize` instructs `EDBConnection` to preallocate the specified number of connections with the server. The default value is `1`. - -`Password` - - When using clear text authentication, specify the password to use to establish a connection with the server. - -`Pooling` - - Specify a value of `false` to disable connection pooling. By default, `Pooling` is set to `true` to enable connection pooling. - -`No Reset On Close` - -When `Pooling` is enabled and the connection is closed, reopened, and the underlying connection is reused, then some operations are executed to discard the previous connection resources. You can override this behavior by enabling `No Reset On Close`. - -`Port` - - The `Port` parameter specifies the port for the application to connect to. - -`Protocol` - - The specific protocol version to use (instead of automatic). Specify an integer value of `2` or `3`. - -`SearchPath` - - Use the `SearchPath` parameter to change the search path to named and public schemas. - -`Server` - - The name or IP address of the EDB Postgres Advanced Server host. - -`SSL` - - Specify a value of `true` to attempt a secure connection. By default, `SSL` is set to `false`. - -`sslmode` - - Use `sslmode` to specify an SSL connection control preference. `sslmode` can be: - -- `prefer` — Use SSL if possible. - -- `require` — Throw an exception if an SSL connection can't be established. - -- `allow` — Connect without SSL. This parameter isn't supported. - -- `disable` — Don't attempt an SSL connection. This is the default behavior. - -`SyncNotification` - - Use the `SyncNotification` parameter to specify for `EDBDataprovider` to use synchronous notifications. The default value is `false`. - -`Timeout` - - `Timeout` specifies the length of time (in seconds) to wait for an open connection. The default value is `15`. - -`User Id` - - The `User Id` parameter specifies the user name to use for the connection. - -## Example: Opening a database connection using ASP.NET - -This example shows how to open a connection to an instance of EDB Postgres Advanced Server and then close the connection. The connection is established using the credentials specified in the `DB_CONN_STRING` configuration parameter. See [Using the .Net Connector](05_using_the_net_connector/#using_the_net_connector) for an introduction to connection information. Also see [Connection string parameters](#connection-string-parameters) for connection parameters. - -```cpp -<% @ Page Language="C#" %> -<% @Import Namespace="EnterpriseDB.EDBClient" %> -<% @Import Namespace="System.Configuration" %> - -``` - -If the connection is successful, a message appears indicating that the connection opened successfully. - -## Example: Opening a database connection from a console application - -This example opens a connection with an EDB Postgres Advanced Server database using a console-based application. - -Before writing the code for the console application, create an `app.config` file that stores the connection string to the database. Using a configuration file makes it convenient to update the connection string if the information changes. - -```ini - - - - - - -``` - -Enter the following code sample into a file: - -```csharp -using System; -using System.Data; -using EnterpriseDB.EDBClient; -using System.Configuration; -namespace EnterpriseDB -{ - class EDB - { - static void Main(string[] args) - { - var strConnectionString = ConfigurationManager.AppSettings["DB_CONN_STRING"]; - try - { - await using var dataSource = EDBDataSource.Create(strConnectionString); - var conn = dataSource.OpenConnection(); - Console.WriteLine("Connection Opened Successfully"); - conn.Close(); - } - catch(Exception exp) - { - throw new Exception(exp.ToString()); - } - } - } -} -``` - -Save the file as `EDBConnection-Sample.cs` and compile it with the following command: - -```text -csc /r:EnterpriseDB.EDBClient.dll /out:Console.exe EDBConnection-Sample.cs` -``` - -Compiling the sample generates a `Console.exe` file. You can execute the sample code by entering `Console.exe`. When executed, the console verifies that it opened successfully. - -## Example: Opening a database connection from a Windows form application - -This example opens a database connection using a .NET WinForm application. To use the example, save the following code as `WinForm-Example.cs` in a directory that contains the library files. - -```csharp -using System; -using System.Windows.Forms; -using System.Drawing; -using EnterpriseDB.EDBClient; -namespace EDBTestClient -{ - class Win_Conn - { - static void Main(string[] args) - { - Form frmMain = new Form(); - Button btnConn = new Button(); - btnConn.Location = new System.Drawing.Point(104, 64); - btnConn.Name = "btnConn"; - btnConn.Text = "Open Connection"; - btnConn.Click += new System.EventHandler(btnConn_Click); - frmMain.Controls.Add(btnConn); - frmMain.Text = "EnterpriseDB"; - Application.Run(frmMain); - } - private static void btnConn_Click(object sender, System.EventArgs e) - { - try - { - var strConnectionString = "Server=localhost;port=5444;username=edb;password=edb;database=edb"; - await using var dataSource = EDBDataSource.Create(strConnectionString); - var conn = dataSource.OpenConnection(); - MessageBox.Show("Connection Opened Successfully"); - conn.Close(); - } - catch(EDBException exp) - { - MessageBox.Show(exp.ToString()); - } - } - } -} -``` - -Change the database connection string to point to the database that you want to connect to. Then compile the file with the following command: - -```text -csc /r:EnterpriseDB.EDBClient.dll /out:WinForm.exe WinForm-Example.cs -``` - -This command generates a `WinForm.exe` file in the same folder that the executable was compiled under. Invoking the executable displays a message that the connection was successful. diff --git a/product_docs/docs/net_connector/7.0.4.1/07_retrieving_database_records.mdx b/product_docs/docs/net_connector/7.0.4.1/07_retrieving_database_records.mdx deleted file mode 100644 index c8c7cc6fb3a..00000000000 --- a/product_docs/docs/net_connector/7.0.4.1/07_retrieving_database_records.mdx +++ /dev/null @@ -1,102 +0,0 @@ ---- -title: "Retrieving database records" - ---- - - - -You can use a `SELECT` statement to retrieve records from the database using a `SELECT` command. To execute a `SELECT` statement you must: - -- Create and open a database connection. -- Create an `EDBCommand` object that represents the `SELECT` statement. -- Execute the command with the `ExecuteReader()` method of the `EDBCommand` object returning `EDBDataReader`. -- Loop through the `EDBDataReader`, displaying the results or binding the `EDBDataReader` to some control. - -An `EDBDataReader` object represents a forward-only and read-only stream of database records, presented one record at a time. To view a subsequent record in the stream, you must call the `Read()` method of the `EDBDataReader` object. - -The example that follows: - -1. Imports the EDB Postgres Advanced Server namespace `EnterpriseDB.EDBClient`. -2. Initializes an `EDBCommand` object with a `SELECT` statement. -3. Opens a connection to the database. -4. Executes the `EDBCommand` by calling the `ExecuteReader` method of the `EDBCommand` object. - -The results of the SQL statement are retrieved into an `EDBDataReader` object. - -Loop through the contents of the `EDBDataReader` object to display the records returned by the query in a `WHILE` loop. - -The `Read()` method advances to the next record (if there is one) and returns `true` if a record exists. It returns `false` if `EDBDataReader` has reached the end of the result set. - -```cpp -<% @ Page Language="C#" %> -<% @Import Namespace="EnterpriseDB.EDBClient" %> -<% @Import Namespace="System.Data" %> -<% @Import Namespace="System.Configuration" %> - - -``` - -To exercise the sample code, save the code in your default web root directory in a file named `selectEmployees.aspx`. Then, to invoke the program, enter the following URL in a browser: `http://localhost/selectEmployees.aspx`. - -## Retrieving a single database record - -To retrieve a single result from a query, use the `ExecuteScalar()` method of the `EDBCommand` object. The `ExecuteScalar()` method returns the first value of the first column of the first row of the `DataSet` generated by the specified query. - -```cpp -<% @ Page Language="C#" %> -<% @Import Namespace="EnterpriseDB.EDBClient" %> -<% @Import Namespace="System.Data" %> -<% @Import Namespace="System.Configuration" %> - -``` - -Save the sample code in a file named `selectscalar.aspx` in a web root directory. - -To invoke the sample code, enter the following in a browser: `http://localhost/selectScalar.aspx` - -The sample includes an explicit conversion of the value returned by the `ExecuteScalar()` method. The `ExecuteScalar()` method returns an object. To view the object, you must convert it to an integer value by using the `Convert.ToInt32` method. diff --git a/product_docs/docs/net_connector/7.0.4.1/08_parameterized_queries.mdx b/product_docs/docs/net_connector/7.0.4.1/08_parameterized_queries.mdx deleted file mode 100644 index c6e393c296f..00000000000 --- a/product_docs/docs/net_connector/7.0.4.1/08_parameterized_queries.mdx +++ /dev/null @@ -1,47 +0,0 @@ ---- -title: "Parameterized queries" - ---- - - - -A _parameterized query_ is a query with one or more parameter markers embedded in the SQL statement. Before executing a parameterized query, you must supply a value for each marker found in the text of the SQL statement. - -Parameterized queries are useful when you don't know the complete text of a query when you write your code. For example, the value referenced in a `WHERE` clause can be calculated from user input. - -As shown in the following example, you must declare the data type of each parameter specified in the parameterized query by creating an `EDBParameter` object and adding that object to the command's parameter collection. Then, you must specify a value for each parameter by calling the parameter's `Value()` function. - -The example shows using a parameterized query with an `UPDATE` statement that increases an employee salary: - -```cpp -<% @ Page Language="C#" Debug="true"%> -<% @Import Namespace="EnterpriseDB.EDBClient" %> -<% @Import Namespace="System.Data" %> -<% @Import Namespace="System.Configuration" %> - -``` - -Save the sample code in a file named `updateSalary.aspx` in a web root directory. - -To invoke the sample code, enter the following in a browser: `http://localhost/updateSalary.aspx` diff --git a/product_docs/docs/net_connector/7.0.4.1/09_inserting_records_in_a_database.mdx b/product_docs/docs/net_connector/7.0.4.1/09_inserting_records_in_a_database.mdx deleted file mode 100644 index 228224eb3b8..00000000000 --- a/product_docs/docs/net_connector/7.0.4.1/09_inserting_records_in_a_database.mdx +++ /dev/null @@ -1,47 +0,0 @@ ---- -title: "Inserting records in a database" - ---- - - - -You can use the `ExecuteNonQuery()` method of `EDBCommand` to add records to a database stored on an EDB Postgres Advanced Server host with an `INSERT` command. - -In the example that follows, the `INSERT` command is stored in the variable `cmd`. The values prefixed with a colon (`:`) are placeholders for `EDBParameters` that are instantiated, assigned values, and then added to the `INSERT` command's parameter collection in the statements that follow. The `INSERT` command is executed by the `ExecuteNonQuery()` method of the `cmdInsert` object. - -The example adds an employee to the `emp` table: - -```cpp -<% @ Page Language="C#" Debug="true"%> -<% @Import Namespace="EnterpriseDB.EDBClient" %> -<% @Import Namespace="System.Data" %> -<% @Import Namespace="System.Configuration" %> - -``` - -Save the sample code in a file named `insertEmployee.aspx` in a web root directory. - -To invoke the sample code, enter the following in a browser: `http://localhost/insertEmployee.aspx` diff --git a/product_docs/docs/net_connector/7.0.4.1/10_deleting_records_in_a_database.mdx b/product_docs/docs/net_connector/7.0.4.1/10_deleting_records_in_a_database.mdx deleted file mode 100644 index 8c797af0868..00000000000 --- a/product_docs/docs/net_connector/7.0.4.1/10_deleting_records_in_a_database.mdx +++ /dev/null @@ -1,44 +0,0 @@ ---- -title: "Deleting records in a database" - ---- - - - -You can use the `ExecuteNonQuery()` method of `EDBCommand` to delete records from a database stored on an EDB Postgres Advanced Server host with a `DELETE` statement. - -In the example that follows, the `DELETE` command is stored in the variable `strDeleteQuery`. The code passes the employee number specified by `EmpNo` to the `DELETE` command. The command is then executed using the `ExecuteNonQuery()` method. - -```cpp -<% @ Page Language="C#" Debug="true"%> -<% @Import Namespace="EnterpriseDB.EDBClient" %> -<% @Import Namespace="System.Data" %> -<% @Import Namespace="System.Configuration" %> - -``` - -Save the sample code in a file named `deleteEmployee.aspx` in a web root directory. - -To invoke the sample code, enter the following in a browser: `http://localhost/deleteEmployee.aspx` diff --git a/product_docs/docs/net_connector/7.0.4.1/11_using_spl_stored_procedures_in_your_net_application.mdx b/product_docs/docs/net_connector/7.0.4.1/11_using_spl_stored_procedures_in_your_net_application.mdx deleted file mode 100644 index 51a2c02f6f6..00000000000 --- a/product_docs/docs/net_connector/7.0.4.1/11_using_spl_stored_procedures_in_your_net_application.mdx +++ /dev/null @@ -1,340 +0,0 @@ ---- -title: "Using SPL stored procedures in your .NET application" - ---- - - - -You can include SQL statements in an application in two ways: - -- By adding the SQL statements directly in the .NET application code -- By packaging the SQL statements in a stored procedure and executing the stored procedure from the .NET application - -In some cases, a stored procedure can provide advantages over embedded SQL statements. Stored procedures support complex conditional and looping constructs that are difficult to duplicate with SQL statements embedded directly in an application. - -You can also see an improvement in performance by using stored procedures. A stored procedure needs to be parsed, compiled, and optimized only once on the server side. A SQL statement that's included in an application might be parsed, compiled, and optimized each time it's executed from a .NET application. - -To use a stored procedure in your .NET application you must: - -1. Create an SPL stored procedure on the EDB Postgres Advanced Server host. -2. Import the `EnterpriseDB.EDBClient` namespace. -3. Pass the name of the stored procedure to the instance of the `EDBCommand`. -4. Change the `EDBCommand.CommandType` to `CommandType.StoredProcedure`. -5. `Prepare()` the command. -6. Execute the command. - -## Example: Executing a stored procedure without parameters - -This sample procedure prints the name of department 10. The procedure takes no parameters and returns no parameters. To create the sample procedure, invoke EDB-PSQL and connect to the EDB Postgres Advanced Server host database. Enter the following SPL code at the command line: - -```sql -CREATE OR REPLACE PROCEDURE list_dept10 -IS - v_deptname VARCHAR2(30); -BEGIN - DBMS_OUTPUT.PUT_LINE('Dept No: 10'); - SELECT dname INTO v_deptname FROM dept WHERE deptno = 10; - DBMS_OUTPUT.PUT_LINE('Dept Name: ' || v_deptname); -END; -``` - -When EDB Postgres Advanced Server validates the stored procedure, it echoes `CREATE PROCEDURE`. - -### Using the EDBCommand object to execute a stored procedure - -The `CommandType` property of the `EDBCommand` object indicates the type of command being executed. The `CommandType` property is set to one of three possible `CommandType` enumeration values: - -- Use the default `Text` value when passing a SQL string for execution. -- Use the `StoredProcedure` value, passing the name of a stored procedure for execution. -- Use the `TableDirect` value when passing a table name. This value passes back all records in the specified table. - -The `CommandText` property must contain a SQL string, stored procedure name, or table name, depending on the value of the `CommandType` property. - -The following example executes the stored procedure: - -```cpp -<% @ Page Language="C#" Debug="true"%> -<% @Import Namespace="EnterpriseDB.EDBClient" %> -<% @Import Namespace="System.Data" %> -<% @Import Namespace="System.Configuration" %> - -``` - -Save the sample code in a file named `storedProc.aspx` in a web root directory. - -To invoke the sample code, enter the following in a browser: `http://localhost/storedProc.aspx` - -## Example: Executing a stored procedure with IN parameters - -This example calls a stored procedure that includes `IN` parameters. To create the sample procedure, invoke EDB-PSQL and connect to the EDB Postgres Advanced Server host database. Enter the following SPL code at the command line: - -```sql -CREATE OR REPLACE PROCEDURE - EMP_INSERT - ( - pENAME IN VARCHAR, - pJOB IN VARCHAR, - pSAL IN FLOAT4, - pCOMM IN FLOAT4, - pDEPTNO IN INTEGER, - pMgr IN INTEGER - ) -AS -DECLARE - CURSOR TESTCUR IS SELECT MAX(EMPNO) FROM EMP; - MAX_EMPNO INTEGER := 10; -BEGIN - - OPEN TESTCUR; - FETCH TESTCUR INTO MAX_EMPNO; - INSERT INTO EMP(EMPNO,ENAME,JOB,SAL,COMM,DEPTNO,MGR) - VALUES(MAX_EMPNO+1,pENAME,pJOB,pSAL,pCOMM,pDEPTNO,pMgr); - CLOSE testcur; -END; - -``` - -When EDB Postgres Advanced Server validates the stored procedure, it echoes `CREATE PROCEDURE`. - -### Passing input values to a stored procedure - -Calling a stored procedure that contains parameters is similar to executing a stored procedure without parameters. The major difference is that, when calling a parameterized stored procedure, you must use the `EDBParameter` collection of the `EDBCommand` object. When the `EDBParameter` is added to the `EDBCommand` collection, properties such as `ParameterName`, `DbType`, `Direction`, `Size`, and `Value` are set. - -This example shows the process of executing a parameterized stored procedure from a C# script: - -```cpp -<% @ Page Language="C#" Debug="true"%> -<% @Import Namespace="EnterpriseDB.EDBClient" %> -<% @Import Namespace="System.Data" %> -<% @Import Namespace="System.Configuration" %> - -``` - -Save the sample code in a file named `storedProcInParam.aspx` in a web root directory. - -To invoke the sample code, enter the following in a browser: `http://localhost/storedProcInParam.aspx` - -In the example, the body of the `Page_Load` method declares and instantiates an `EDBConnection` object. The sample then creates an `EDBCommand` object with the properties needed to execute the stored procedure. - -The example then uses the `Add` method of the `EDBCommand Parameter` collection to add six input parameters. - -```cpp -EDBCommand cmdStoredProc = new EDBCommand -("emp_insert(:EmpName,:Job,:Salary,:Commission,:DeptNo,:Manager)",conn); -cmdStoredProc.CommandType = CommandType.StoredProcedure; -``` - -It assigns a value to each parameter before passing them to the `EMP_INSERT` stored procedure. - -The `Prepare()` method prepares the statement before calling the `ExecuteNonQuery()` method. - -The `ExecuteNonQuery` method of the `EDBCommand` object executes the stored procedure. After the stored procedure executes, a test record is inserted into the `emp` table, and the values inserted are displayed on the web page. - -## Example: Executing a stored procedure with IN, OUT, and INOUT parameters - -The previous example showed how to pass `IN` parameters to a stored procedure. The following examples show how to pass `IN` values and return `OUT` values from a stored procedure. - -### Creating the stored procedure - -The following stored procedure passes the department number and returns the corresponding location and department name. To create the sample procedure, invoke EDB-PSQL and connect to the EDB Postgres Advanced Server host database. Enter the following SPL code at the command line: - -```sql -CREATE OR REPLACE PROCEDURE - DEPT_SELECT - ( - pDEPTNO IN INTEGER, - pDNAME OUT VARCHAR, - pLOC OUT VARCHAR - ) -AS -DECLARE - CURSOR TESTCUR IS SELECT DNAME,LOC FROM DEPT; - REC RECORD; -BEGIN - - OPEN TESTCUR; - FETCH TESTCUR INTO REC; - - pDNAME := REC.DNAME; - pLOC := REC.LOC; - - CLOSE testcur; -END; -``` - -When EDB Postgres Advanced Server validates the stored procedure, it echoes `CREATE PROCEDURE`. - -### Receiving output values from a stored procedure - -When retrieving values from `OUT` parameters, you must explicitly specify the direction of those parameters as `Output`. You can retrieve the values from `Output` parameters in two ways: - -- Call the `ExecuteReader` method of the `EDBCommand` and explicitly loop through the returned `EDBDataReader`, searching for the values of `OUT` parameters. -- Call the `ExecuteNonQuery` method of `EDBCommand` and explicitly get the value of a declared `Output` parameter by calling that `EDBParameter` value property. - -In each method, you must declare each parameter, indicating the direction of the parameter (`ParameterDirection.Input`, `ParameterDirection.Output`, or `ParameterDirection.InputOutput`). Before invoking the procedure, you must provide a value for each `IN` and `INOUT` parameter. After the procedure returns, you can retrieve the `OUT` and `INOUT` parameter values from the `command.Parameters[]` array. - -This code shows using the `ExecuteReader` method to retrieve a result set: - -```cpp -<% @ Page Language="C#" Debug="true"%> -<% @Import Namespace="EnterpriseDB.EDBClient" %> -<% @Import Namespace="System.Data" %> -<% @Import Namespace="System.Configuration" %> - -``` - -This code shows using the `ExecuteNonQuery` method to retrieve a result set: - -```cpp -<% @ Page Language="C#" Debug="true"%> -<% @Import Namespace="EnterpriseDB.EDBClient" %> -<% @Import Namespace="System.Data" %> -<% @Import Namespace="System.Configuration" %> - -``` diff --git a/product_docs/docs/net_connector/7.0.4.1/12_using_advanced_queueing.mdx b/product_docs/docs/net_connector/7.0.4.1/12_using_advanced_queueing.mdx deleted file mode 100644 index d50395d0e8f..00000000000 --- a/product_docs/docs/net_connector/7.0.4.1/12_using_advanced_queueing.mdx +++ /dev/null @@ -1,492 +0,0 @@ ---- -title: "Using advanced queueing" - ---- - - - -EDB Postgres Advanced Server advanced queueing provides message queueing and message processing for the EDB Postgres Advanced Server database. User-defined messages are stored in a queue. A collection of queues is stored in a queue table. Create a queue table before creating a queue that depends on it. - -On the server side, procedures in the `DBMS_AQADM` package create and manage message queues and queue tables. Use the `DBMS_AQ` package to add messages to or remove messages from a queue or register or unregister a PL/SQL callback procedure. For more information about `DBMS_AQ` and `DBMS_AQADM`, see [DBMS_AQ](/epas/latest/reference/oracle_compatibility_reference/epas_compat_bip_guide/03_built-in_packages/02_dbms_aq/). - -On the client side, the application uses the EDB.NET driver to enqueue and dequeue messages. - -## Enqueueing or dequeueing a message - -For more information about using EDB Postgres Advanced Server's advanced queueing functionality, see [Built-in packages](/epas/latest/reference/oracle_compatibility_reference/epas_compat_bip_guide/). - -### Server-side setup - -To use advanced queueing functionality on your .NET application, you must first create a user-defined type, queue table, and queue, and then start the queue on the database server. Invoke EDB-PSQL and connect to the EDB Postgres Advanced Server host database. Use the following SPL commands at the command line: - -#### Creating a user-defined type - -To specify a RAW data type, create a user-defined type. This example shows creating a user-defined type named as `myxml`: - -``` -CREATE TYPE myxml AS (value XML); -``` - -#### Creating the queue table - -A queue table can hold multiple queues with the same payload type. This example shows creating a table named `MSG_QUEUE_TABLE`: - -```Text -EXEC DBMS_AQADM.CREATE_QUEUE_TABLE - (queue_table => 'MSG_QUEUE_TABLE', - queue_payload_type => 'myxml', - comment => 'Message queue table'); -END; -``` - -#### Creating the queue - -This example shows creating a queue named `MSG_QUEUE` in the table `MSG_QUEUE_TABLE`: - -```Text -BEGIN -DBMS_AQADM.CREATE_QUEUE ( queue_name => 'MSG_QUEUE', queue_table => 'MSG_QUEUE_TABLE', comment => 'This queue contains pending messages.'); -END; -``` - -**Starting the queue** - -Once the queue is created, invoke the following SPL code at the command line to start a queue in the EDB database: - -```Text -BEGIN -DBMS_AQADM.START_QUEUE -(queue_name => 'MSG_QUEUE'); -END; -``` - -### Client-side example - -Once you've created a user-defined type, followed by queue table and queue, start the queue. Then, you can enqueue or dequeue a message using EDB .Net drivers. - -#### Enqueue a message - -To enqueue a message on your .NET application, you must: - -1. Import the `EnterpriseDB.EDBClient` namespace. -2. Pass the name of the queue and create the instance of the `EDBAQQueue`. -3. Create the enqueue message and define a payload. -4. Call the `queue.Enqueue` method. - -The following code shows using the `queue.Enqueue` method. - -!!! Note - This code creates the message and serializes it. This is example code and doesn't compile if copied as it is. You must serialize the message as XML. - -```Text -using EnterpriseDB.EDBClient; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace AQXml -{ - class MyXML - { - public string value { get; set; } - } - class Program - { - static void Main(string[] args) - { - int messagesToSend = 1; - if (args.Length > 0 && !string.IsNullOrEmpty(args[0])) - { - messagesToSend = int.Parse(args[0]); - } - for (int i = 0; i < 5; i++) - { - EnqueMsg("test message: " + i); - } - } - - private static EDBConnection GetConnection() - { - string connectionString = "Server=127.0.0.1;Host=127.0.0.1;Port=5444;User Id=enterprisedb;Password=test;Database=edb;Timeout=999"; - EDBConnection connection = new EDBConnection(connectionString); - connection.Open(); - return connection; - } - - - private static string ByteArrayToString(byte[] byteArray) - { - // Sanity check if it's null so we don't incur overhead of an exception - if (byteArray == null) - { - return string.Empty; - } - try - { - StringBuilder hex = new StringBuilder(byteArray.Length * 2); - foreach (byte b in byteArray) - { - hex.AppendFormat("{0:x2}", b); - } - - return hex.ToString().ToUpper(); - } - catch - { - return string.Empty; - } - } - - private static bool EnqueMsg(string msg) - { - EDBConnection con = GetConnection(); - using (EDBAQQueue queue = new EDBAQQueue("MSG_QUEUE", con)) - { - queue.MessageType = EDBAQMessageType.Xml; - EDBTransaction txn = queue.Connection.BeginTransaction(); - QueuedEntities.Message queuedMessage = new QueuedEntities.Message() { MessageText = msg }; - - try - { - string rootElementName = queuedMessage.GetType().Name; - if (rootElementName.IndexOf(".") != -1) - { - rootElementName = rootElementName.Split('.').Last(); - } - - string xml = new Utils.XmlFragmentSerializer().Serialize(queuedMessage); - EDBAQMessage queMsg = new EDBAQMessage(); - queMsg.Payload = new MyXML { value = xml }; - queue.MessageType = EDBAQMessageType.Udt; - queue.UdtTypeName = "myxml"; - EDBConnection.GlobalTypeMapper.MapComposite("myxml"); - con.ReloadTypes(); - queue.Enqueue(queMsg); - var messageId = ByteArrayToString((byte[])queMsg.MessageId); - Console.WriteLine("MessageID: " + messageId); - txn.Commit(); - queMsg = null; - xml = null; - rootElementName = null; - return true; - } - catch (Exception ex) - { - txn?.Rollback(); - Console.WriteLine("Failed to enqueue message."); - Console.WriteLine(ex.ToString()); - return false; - } - finally - { - queue?.Connection?.Dispose(); - } - } - } - - } -} -``` - -#### Dequeueing a message - -To dequeue a message on your .NET application, you must: - -1. Import the `EnterpriseDB.EDBClient` namespace. -2. Pass the name of the queue and create the instance of the `EDBAQQueue`. -3. Call the `queue.Dequeue` method. - -!!! Note - The following code creates the message and serializes it. This is example code and doesn't compile if copied as it is. You must serialize the message as XML. - -```Text -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using EnterpriseDB.EDBClient; - -namespace DequeueXML -{ - class MyXML - { - public string value { get; set; } - } - class Program - { - static void Main(string[] args) - { - DequeMsg(); - } - - - private static EDBConnection GetConnection() - { - string connectionString = "Server=127.0.0.1;Host=127.0.0.1;Port=5444;User Id=enterprisedb;Password=test;Database=edb;Timeout=999"; - EDBConnection connection = new EDBConnection(connectionString); - connection.Open(); - return connection; - } - - - private static string ByteArrayToString(byte[] byteArray) - { - // Sanity check if it's null so we don't incur overhead of an exception - if (byteArray == null) - { - return string.Empty; - } - try - { - StringBuilder hex = new StringBuilder(byteArray.Length * 2); - foreach (byte b in byteArray) - { - hex.AppendFormat("{0:x2}", b); - } - - return hex.ToString().ToUpper(); - } - catch - { - return string.Empty; - } - } - public static void DequeMsg(int waitTime = 10) - { - EDBConnection con = GetConnection(); - using (EDBAQQueue queueListen = new EDBAQQueue("MSG_QUEUE", con)) - { - queueListen.UdtTypeName = "myxml"; - queueListen.DequeueOptions.Navigation = EDBAQNavigationMode.FIRST_MESSAGE; - queueListen.DequeueOptions.Visibility = EDBAQVisibility.ON_COMMIT; - queueListen.DequeueOptions.Wait = 1; - EDBTransaction txn = null; - - while (1 == 1) - { - - if (queueListen.Connection.State == System.Data.ConnectionState.Closed) - { - queueListen.Connection.Open(); - } - - string messageId = "Unknown"; - try - { - // the listen function is a blocking function. It will Wait the specified waitTime or until a - // message is received. - Console.WriteLine("Listening..."); - string v = queueListen.Listen(null, waitTime); - // If we are waiting for a message and we specify a Wait time, - // then if there are no more messages, we want to just bounce out. - if (waitTime > -1 && v == null) - { - Console.WriteLine("No message received during Wait period."); - Console.WriteLine(); - continue; - } - - // once we're here that means a message has been detected in the queue. Let's deal with it. - txn = queueListen.Connection.BeginTransaction(); - - Console.WriteLine("Attempting to dequeue message..."); - // dequeue the message - EDBAQMessage deqMsg; - try - { - deqMsg = queueListen.Dequeue(); - } - catch (Exception ex) - { - if (ex.Message.Contains("ORA-25228")) - { - Console.WriteLine("Message was not there. Another process must have picked it up."); - Console.WriteLine(); - txn.Rollback(); - continue; - } - else - { - throw; - } - } - - messageId = ByteArrayToString((byte[])deqMsg.MessageId); - if (deqMsg != null) - { - Console.WriteLine("Processing received message..."); - // process the message payload - MyXML obj = (MyXML) deqMsg.Payload; - - QueuedEntities.Message msg = new Utils.XmlFragmentSerializer().Deserialize(obj.value); - - Console.WriteLine("Received Message:"); - Console.WriteLine("MessageID: " + messageId); - Console.WriteLine("Message: " + msg.MessageText); - Console.WriteLine("Enqueue Time" + queueListen.MessageProperties.EnqueueTime); - - txn.Commit(); - - Console.WriteLine("Finished processing message"); - Console.WriteLine(); - - } - else - { - Console.WriteLine("Message was not dequeued."); - } - } - catch (Exception ex) - { - Console.WriteLine("Failed To dequeue or process the dequeued message."); - Console.WriteLine(ex.ToString()); - Console.WriteLine(); - if (txn != null) - { - txn.Rollback(); - if (txn != null) - { - txn.Dispose(); - } - } - } - } - } - - } - } -} -``` - -## EDBAQ classes - -The following EDBAQ classes are used in this application. - -### EDBAQDequeueMode - -The `EDBAQDequeueMode` class lists all the dequeuer modes available. - -| Value | Description | -| ------------- | ------------------------------------------------------------- | -| Browse | Reads the message without locking. | -| Locked | Reads and gets a write lock on the message. | -| Remove | Deletes the message after reading. This is the default value. | -| Remove_NoData | Confirms receipt of the message. | - -### EDBAQDequeueOptions - -The `EDBAQDequeueOptions` class lists the options available when dequeuing a message. - -| Property | Description | -| -------------- | ------------------------------------------------------------------------------------------------------------------------------ | -| ConsumerName | The name of the consumer for which to dequeue the message. | -| DequeueMode | Set from `EDBAQDequeueMode`. It represents the locking behavior linked with the dequeue option. | -| Navigation | Set from `EDBAQNavigationMode`. It represents the position of the message to fetch. | -| Visibility | Set from `EDBAQVisibility`. It represents whether the new message is dequeued as part of the current transaction. | -| Wait | The wait time for a message as per the search criteria. | -| Msgid | The message identifier. | -| Correlation | The correlation identifier. | -| DeqCondition | The dequeuer condition. It's a Boolean expression. | -| Transformation | The transformation to apply before dequeuing the message. | -| DeliveryMode | The delivery mode of the dequeued message. | - -### EDBAQEnqueueOptions - -The `EDBAQEnqueueOptions` class lists the options available when enqueuing a message. - -| Property | Description | -| ----------------- | ------------------------------------------------------------------------------------------------------------------------------ | -| Visibility | Set from `EDBAQVisibility`. It represents whether the new message is enqueued as part of the current transaction. | -| RelativeMsgid | The relative message identifier. | -| SequenceDeviation | The sequence when to dequeue the message. | -| Transformation | The transformation to apply before enqueuing the message. | -| DeliveryMode | The delivery mode of the enqueued message. | - -### EDBAQMessage - -The `EDBAQMessage` class lists a message to enqueue/dequeue. - -| Property | Description | -| ------------ | -------------------------------- | -| Payload | The actual message to queue. | -| MessageId | The ID of the queued message. | - -### EDBAQMessageProperties - -The `EDBAQMessageProperties` lists the message properties available. - -| Property | Description | -| ---------------- | --------------------------------------------------------------------------------------------- | -| Priority | The priority of the message. | -| Delay | The duration after which the message is available for dequeuing, in seconds. | -| Expiration | The duration for which the message is available for dequeuing, in seconds. | -| Correlation | The correlation identifier. | -| Attempts | The number of attempts taken to dequeue the message. | -| RecipientList | The recipients list that overthrows the default queue subscribers. | -| ExceptionQueue | The name of the queue to move the unprocessed messages to. | -| EnqueueTime | The time when the message was enqueued. | -| State | The state of the message while dequeued. | -| OriginalMsgid | The message identifier in the last queue. | -| TransactionGroup | The transaction group for the dequeued messages. | -| DeliveryMode | The delivery mode of the dequeued message. | - -### EDBAQMessageState - -The `EDBAQMessageState` class represents the state of the message during dequeue. - -| Value | Description | -| --------- | --------------------------------------------------------- | -| Expired | The message is moved to the exception queue. | -| Processed | The message is processed and kept. | -| Ready | The message is ready to be processed. | -| Waiting | The message is in waiting state. The delay isn't reached. | - -### EDBAQMessageType - -The `EDBAQMessageType` class represents the types for payload. - -| Value | Description | -| --------- | ------------------------------------------------------------------------------------- | -| Raw | The raw message type.

Note: Currently, this payload type isn't supported. | -| UDT | The user-defined type message. | -| XML | The XML type message.

Note: Currently, this payload type isn't supported. | - -### EDBAQNavigationMode - -The `EDBAQNavigationMode` class represents the different types of navigation modes available. - -| Value | Description | -| ---------------- | ------------------------------------------------------------------ | -| First_Message | Returns the first available message that matches the search terms. | -| Next_Message | Returns the next available message that matches the search items. | -| Next_Transaction | Returns the first message of next transaction group. | - -### EDBAQQueue - -The `EDBAQQueue` class represents a SQL statement to execute `DMBS_AQ` functionality on a PostgreSQL database. - -| Property | Description | -| ----------------- | --------------------------------------------------------------------------------------------- | -| Connection | The connection to use. | -| Name | The name of the queue. | -| MessageType | The message type that's enqueued/dequeued from this queue, for example `EDBAQMessageType.Udt`. | -| UdtTypeName | The user-defined type name of the message type. | -| EnqueueOptions | The enqueue options to use. | -| DequeuOptions | The dequeue options to use. | -| MessageProperties | The message properties to use. | - -### EDBAQVisibility - -The `EDBAQVisibility` class represents the visibility options available. - -| Value | Description | -| --------- | ----------------------------------------------------------- | -| Immediate | The enqueue/dequeue isn't part of the ongoing transaction. | -| On_Commit | The enqueue/dequeue is part of the current transaction. | - -!!! Note - - To review the default options for these parameters, see [DBMS_AQ](../../epas/11/epas_compat_bip_guide/03_built-in_packages/02_dbms_aq/). - - EDB advanced queueing functionality uses user-defined types for calling enqueue/dequeue operations. `Server Compatibility Mode=NoTypeLoading` can't be used with advanced queueing because `NoTypeLoading` doesn't load any user-defined types. diff --git a/product_docs/docs/net_connector/7.0.4.1/13_using_a_ref_cursor_in_a_net_application.mdx b/product_docs/docs/net_connector/7.0.4.1/13_using_a_ref_cursor_in_a_net_application.mdx deleted file mode 100644 index 3b77d3f4ba8..00000000000 --- a/product_docs/docs/net_connector/7.0.4.1/13_using_a_ref_cursor_in_a_net_application.mdx +++ /dev/null @@ -1,104 +0,0 @@ ---- -title: "Using a ref cursor in a .NET application" - ---- - - - -A `ref cursor` is a cursor variable that contains a pointer to a query result set. The result set is determined by executing the `OPEN FOR` statement using the cursor variable. A cursor variable isn't tied to a particular query like a static cursor. You can open the same cursor variable a number of times with the `OPEN FOR` statement containing different queries and each time. A new result set is created for that query and made available by way of the cursor variable. You can declare a cursor variable in two ways: - -- Use the `SYS_REFCURSOR` built-in data type to declare a weakly typed ref cursor. -- Define a strongly typed ref cursor that declares a variable of that type. - -`SYS_REFCURSOR` is a ref cursor type that allows any result set to be associated with it. This is known as a weakly typed ref cursor. The following example is a declaration of a weakly typed ref cursor: - -``` - name SYS_REFCURSOR`; -``` - -Following is an example of a strongly typed ref cursor: - -``` -TYPE IS REF CURSOR RETURN emp%ROWTYPE`; -``` - -## Creating the stored procedure - -This sample code creates a stored procedure called `refcur_inout_callee`. It specifies the data type of the ref cursor being passed as an OUT parameter. To create the sample procedure, invoke EDB-PSQL and connect to the EDB Postgres Advanced Server host database. Enter the following SPL code at the command line: - -```sql -CREATE OR REPLACE PROCEDURE - refcur_inout_callee(v_refcur OUT SYS_REFCURSOR) -IS -BEGIN - OPEN v_refcur FOR SELECT ename FROM emp; -END; -``` - -This C# code uses the stored procedure to retrieve employee names from the `emp` table: - -```cpp -using System; -using System.Data; -using EnterpriseDB.EDBClient; -using System.Configuration; -namespace EDBRefCursor -{ - class EmpRefcursor - { - [STAThread] - static void Main(string[] args) - { - var strConnectionString = - ConfigurationManager.AppSettings["DB_CONN_STRING"]; - try - { - await using var dataSource = EDBDataSource.Create(ConnectionString); - var conn = await dataSource.OpenConnectionAsync(); - await using var tran = await connection.BeginTransactionAsync(); - using var command = new EDBCommand("refcur_inout_callee", conn); - command.CommandType = CommandType.StoredProcedure; - command.Transaction = tran; - command.Parameters.Add(new EDBParameter("refCursor", - EDBTypes.EDBDbType.Refcursor, 10, "refCursor", - ParameterDirection.Output, false, 2, 2, - System.Data.DataRowVersion.Current, null)); - await command.PrepareAsync(); - command.Parameters[0].Value = null; - await command.ExecuteNonQueryAsync(); - var cursorName = command.Parameters[0].Value.ToString(); - command.CommandText = "fetch all in \"" + cursorName + "\""; - command.CommandType = CommandType.Text; - await using var reader = - await command.ExecuteReaderAsync(CommandBehavior.SequentialAccess); - var fc = reader.FieldCount; - while (await reader.ReadAsync()) - { - for (int i = 0; i < fc; i++) - { - Console.WriteLine(reader.GetString(i)); - } - } - await reader.CloseAsync(); - await tran.CommitAsync(); - await conn.CloseAsync(); - } - catch (Exception ex) - { - Console.WriteLine(ex.Message.ToString()); - } - } - } -} -``` - -This .NET code snippet displays the result on the console: - -```cpp -for(int i = 0;i < fc; i++) -{ - Console.WriteLine(reader.GetString(i)); -} -``` - -You must bind the `EDBDbType.RefCursor` type in `EDBParameter()` if you're using a ref cursor parameter. diff --git a/product_docs/docs/net_connector/7.0.4.1/14_using_plugins.mdx b/product_docs/docs/net_connector/7.0.4.1/14_using_plugins.mdx deleted file mode 100644 index 8f60d1b3f57..00000000000 --- a/product_docs/docs/net_connector/7.0.4.1/14_using_plugins.mdx +++ /dev/null @@ -1,55 +0,0 @@ ---- -title: "Using plugins" - ---- - - - -EDB .Net driver plugins support the enhanced capabilities for different data types that are otherwise not available in .Net. The different plugins available support: - -- GeoJSON -- Json.NET -- NetTopologySuite -- NodaTime - -The plugins support the use of spatial, data/time, and JSON types. The following are the supported frameworks and data provider installation path for these plugins. - -## GeoJSON - -If you're using the GeoJSON plugin on .NET Standard 2.0, the data provider installation path is `C:\Program Files\edb\dotnet\plugins\GeoJSON\netstandard2.0`. - -The following shared library files are required: - -- `EnterpriseDB.EDBClient.GeoJSON.dll` - -For detailed information about using the GeoJSON plugin, see the [Npgsql documentation](http://www.npgsql.org/doc/types/geojson.html). - -## Json.NET - -If you're using the Json.NET plugin on .NET Standard 2.0, the data provider installation path is `C:\Program Files\edb\dotnet\plugins\Json.NET\netstandard2.0`. - -The following shared library files are required: - -- `EnterpriseDB.EDBClient.Json.NET.dll` - -For detailed information about using the Json.NET plugin, see the [Npgsql documentation](http://www.npgsql.org/doc/types/jsonnet.html). - -## NetTopologySuite - -If you're using the NetTopologySuite plugin on .Net Standard 2.0, the data provider installation path is `C:\Program Files\edb\dotnet\plugins\NetTopologySuite\netstandard2.0`. - -The following shared library files are required: - -- `EnterpriseDB.EDBClient.NetTopologySuite.dll` - -For detailed information about using the NetTopologySuite type plugin, see the [Npgsql documentation](http://www.npgsql.org/doc/types/nts.html). - -## NodaTime - -If you're using the NodaTime plugin on .Net Standard 2.0, the data provider installation path is `C:\Program Files\edb\dotnet\plugins\NodaTime\netstandard2.0`. - -The following shared library files are required: - -- `EnterpriseDB.EDBClient.NodaTime.dll` - -For detailed information about using the NodaTime plugin, see the [Npgsql documentation](http://www.npgsql.org/doc/types/nodatime.html). diff --git a/product_docs/docs/net_connector/7.0.4.1/15_using_object_types.mdx b/product_docs/docs/net_connector/7.0.4.1/15_using_object_types.mdx deleted file mode 100644 index c57c5ba4713..00000000000 --- a/product_docs/docs/net_connector/7.0.4.1/15_using_object_types.mdx +++ /dev/null @@ -1,181 +0,0 @@ ---- -title: "Using object types in .NET" - ---- - - - -The SQL `CREATE TYPE` command creates a user-defined object type, which is stored in the EDB Postgres Advanced Server database. You can then reference these user-defined types in SPL procedures, SPL functions, and .NET programs. - -Create the basic object type with the `CREATE TYPE AS OBJECT` command. Optionally, use the `CREATE TYPE BODY` command. - -## Using an object type - -To use an object type, you must first create the object type in the EDB Postgres Advanced Server database. Object type `addr_object_type` defines the attributes of an address: - -```text -CREATE OR REPLACE TYPE addr_object_type AS OBJECT -( - street VARCHAR2(30), - city VARCHAR2(20), - state CHAR(2), - zip NUMBER(5) -); -``` - -Object type `emp_obj_typ` defines the attributes of an employee. One of these attributes is object type `ADDR_OBJECT_TYPE`, as previously described. The object type body contains a method that displays the employee information: - -```text -CREATE OR REPLACE TYPE emp_obj_typ AS OBJECT -( - empno NUMBER(4), - ename VARCHAR2(20), - addr ADDR_OBJECT_TYPE, - MEMBER PROCEDURE display_emp(SELF IN OUT emp_obj_typ) -); - -CREATE OR REPLACE TYPE BODY emp_obj_typ AS - MEMBER PROCEDURE display_emp (SELF IN OUT emp_obj_typ) - IS - BEGIN - DBMS_OUTPUT.PUT_LINE('Employee No : ' || SELF.empno); - DBMS_OUTPUT.PUT_LINE('Name : ' || SELF.ename); - DBMS_OUTPUT.PUT_LINE('Street : ' || SELF.addr.street); - DBMS_OUTPUT.PUT_LINE('City/State/Zip: ' || SELF.addr.city || ', ' || - SELF.addr.state || ' ' || LPAD(SELF.addr.zip,5,'0')); - END; -END; -``` - -This example is a complete .NET program that uses these user-defined object types: - -```text -using EnterpriseDB.EDBClient; -using System.Data.Common; -namespace TypesTest -{ - internal class Program - { - static async Task Main(string[] args) - { - var connString = "Server=localhost;Port=5444;database=edb;User ID=enterprisedb;password=edb;"; - var dataSourceBuilder = new EDBDataSourceBuilder(connString); - dataSourceBuilder.MapComposite("enterprisedb.addr_object_type"); - dataSourceBuilder.MapComposite("enterprisedb.emp_obj_typ"); - await using var dataSource = dataSourceBuilder.Build(); - await using var conn = await dataSource.OpenConnectionAsync(); - try - { - var address = new addr_object_type() - { - street = "123 MAIN STREET", - city = "EDISON", - state = "NJ", - zip = 8817 - }; - var emp = new emp_obj_typ() - { - empno = 9001, - ename = "JONES", - addr = address - }; - await using (var cmd = new EDBCommand("emp_obj_typ.display_emp", conn)) - { - cmd.CommandType = System.Data.CommandType.StoredProcedure; - EDBCommandBuilder.DeriveParameters(cmd); - cmd.Parameters[0].Value = emp; - cmd.Prepare(); - cmd.ExecuteNonQuery(); - var empOut = (emp_obj_typ?)cmd.Parameters[0].Value; - Console.WriteLine("Emp No: " + empOut.empno); - Console.WriteLine("Emp Name: " + empOut.ename); - Console.WriteLine("Emp Address Street: " + empOut.addr.street); - Console.WriteLine("Emp Address City: " + empOut.addr.city); - Console.WriteLine("Emp Address State: " + empOut.addr.state); - Console.WriteLine("Emp Address Zip: " + empOut.addr.zip); - Console.WriteLine("Emp No: " + empOut.empno); - } - } - catch (EDBException exp) - { - Console.WriteLine(exp.Message.ToString()); - } - finally - { - conn.Close(); - } - } - } -public class addr_object_type - { - public string? street; - public string? city; - public string? state; - public decimal zip; - } - public class emp_obj_typ - { - public decimal empno; - public string? ename; - public addr_object_type? addr; - } -} -``` - -The following .NET types are defined to map to the types in EDB Postgres Advanced Server: - -```text -public class addr_object_type -{ -public string? street; -public string? city; -public string? state; -public decimal zip; -} - -public class emp_obj_typ -{ - public decimal empno; - public string? ename; - public addr_object_type? addr; -} -``` - -A call to `EDBDataSourceBuilder.MapComposite` maps the .NET type to the EDB Postgres Advanced Server types: - -```text -dataSourceBuilder.MapComposite("enterprisedb.addr_object_type"); -dataSourceBuilder.MapComposite("enterprisedb.emp_obj_typ"); -``` - -A call to `EDBCommandBuilder.DeriveParameters()` gets parameter information for a stored procedure. This allows you to just set the parameter values and call the stored procedure: - -```text -EDBCommandBuilder.DeriveParameters(cmd); -``` - -Set the value of the parameter by creating an object of the .NET type and assigning it to the `Value` property of the parameter: - -```text -addr_object_type address = new addr_object_type() -{ - street = "123 MAIN STREET", - city = "EDISON", - state = "NJ", - zip = 8817 -}; - -emp_obj_typ emp = new emp_obj_typ() -{ - empno = 9001, - ename = "JONES", - addr = address -}; -cmd.Parameters[0].Value = emp; -``` - -A call to `cmd.ExecuteNonQuery()` executes the call to the `display_emp()` method: - -```text -cmd.ExecuteNonQuery(); -``` diff --git a/product_docs/docs/net_connector/7.0.4.1/16_scram_compatibility.mdx b/product_docs/docs/net_connector/7.0.4.1/16_scram_compatibility.mdx deleted file mode 100644 index feff2da342b..00000000000 --- a/product_docs/docs/net_connector/7.0.4.1/16_scram_compatibility.mdx +++ /dev/null @@ -1,10 +0,0 @@ ---- -title: "Scram compatibility" -legacyRedirects: - - "/edb-docs/d/edb-postgres-net-connector/user-guides/net-guide/4.1.6.1/security_and_encryption.html" - ---- - - - -The EDB .NET driver provides SCRAM-SHA-256 support for EDB Postgres Advanced Server version 10 and later. This support is available from EDB .NET 4.0.2.1 release and later. diff --git a/product_docs/docs/net_connector/7.0.4.1/17_advanced_server_net_connector_logging.mdx b/product_docs/docs/net_connector/7.0.4.1/17_advanced_server_net_connector_logging.mdx deleted file mode 100644 index 03bd1ed820a..00000000000 --- a/product_docs/docs/net_connector/7.0.4.1/17_advanced_server_net_connector_logging.mdx +++ /dev/null @@ -1,82 +0,0 @@ ---- -title: "EDB .NET Connector logging" - ---- - - - -EDB .NET Connector supports the use of logging to help resolve issues with the .NET Connector when used in your application. EDB .NET Connector supports logging using the standard .NET `Microsoft.Extensions.Logging` package. For more information about logging in .Net, see [Logging in C# and .NET](https://learn.microsoft.com/en-us/dotnet/core/extensions/logging?tabs=command-line). - -!!! Note - For versions earlier than 7.x, EDB .NET Connector had its own, custom logging API. - -## Console logging provider - -.NET logging API works with a variety of built-in and third-party logging providers. The console logging provider logs output to the console. - -### Console logging with EDBDataSource - -Create a `Microsoft.Extensions.Logging.LoggerFactory` and configure an `EDBDataSource` with it. Any use of connections opened through this data source log using this logger factory. - -```text -var loggerFactory = LoggerFactory.Create(builder => builder.AddSimpleConsole()); - -var dataSourceBuilder = new EDBDataSourceBuilder(connectionString); -dataSourceBuilder.UseLoggerFactory(loggerFactory); -await using var dataSource = dataSourceBuilder.Build(); - -await using var connection = await dataSource.OpenConnectionAsync(); -await using var command = new EDBCommand("SELECT 1", connection); -_ = await command.ExecuteScalarAsync(); -``` - -### Console logging without EDBDataSource - -Create a `Microsoft.Extensions.Logging.LoggerFactory` and configure EDB .NET Connector's logger factory globally using `EDBLoggingConfiguration.InitializeLogging`. Configure it at the start of your program, before using any other EDB .NET Connector API. - -```text -var loggerFactory = LoggerFactory.Create(builder => builder.AddSimpleConsole()); -EDBLoggingConfiguration.InitializeLogging(loggerFactory); - -await using var conn = new EDBConnection(connectionString); -await conn.OpenAsync(); -await using var command = new EDBCommand("SELECT 1", conn); -_ = await command.ExecuteScalarAsync(); -``` - -## Log levels - -The following log levels are available: - -- Trace -- Debug -- Information -- Warning -- Error -- Fatal - -This example shows how to change the log level to `Trace`: - -```text -var loggerFactory = LoggerFactory.Create(builder => builder -.SetMinimumLevel(LogLevel.Trace -.AddSimpleConsole() -); -``` - -## Formatting the log output - -This example shows how to format your log output. Create a `LoggerFactory` to restrict each log message to a single line and add a date time to the log: - -```text -var loggerFactory = LoggerFactory.Create(builder => -builder -.SetMinimumLevel(LogLevel.Trace) -.AddSimpleConsole( - options => - { - options.SingleLine = true; - options.TimestampFormat = "yyyy/MM/dd HH:mm:ss "; - } - )); -``` \ No newline at end of file diff --git a/product_docs/docs/net_connector/7.0.4.1/18_api_reference.mdx b/product_docs/docs/net_connector/7.0.4.1/18_api_reference.mdx deleted file mode 100644 index 53050c37952..00000000000 --- a/product_docs/docs/net_connector/7.0.4.1/18_api_reference.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -title: "API reference" - ---- - - - -For information about using the API, see the [Npgsql documentation](http://www.npgsql.org/doc/api/Npgsql.html). - -Usage notes: - -- When using the API, replace references to `Npgsql` with `EnterpriseDB.EDBClient`. -- When referring to classes, replace `Npgsql` with `EDB`. For example, use the `EDBBinaryExporter` class instead of the `NpgsqlBinaryExporter` class. diff --git a/product_docs/docs/net_connector/7.0.4.1/images/connection_opened_successfully.png b/product_docs/docs/net_connector/7.0.4.1/images/connection_opened_successfully.png deleted file mode 100755 index bab12126d20..00000000000 --- a/product_docs/docs/net_connector/7.0.4.1/images/connection_opened_successfully.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:537e7edecce3882b794110e0ffc644a51cab69ba2c7e7f82a3e99d32c4b4ba65 -size 22683 diff --git a/product_docs/docs/net_connector/7.0.4.1/images/dialog.png b/product_docs/docs/net_connector/7.0.4.1/images/dialog.png deleted file mode 100755 index 19cba54d1f9..00000000000 --- a/product_docs/docs/net_connector/7.0.4.1/images/dialog.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:f922e6cd4e43927708b5f460f5389a5b3a41dd70f3a5394723e6aee7d710f1ae -size 9048 diff --git a/product_docs/docs/net_connector/7.0.4.1/images/dotnet_installation_complete.png b/product_docs/docs/net_connector/7.0.4.1/images/dotnet_installation_complete.png deleted file mode 100755 index 332ae795899..00000000000 --- a/product_docs/docs/net_connector/7.0.4.1/images/dotnet_installation_complete.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:0983f216ce071f57f7e758980c3f966caded4312412905a6aba66efa362fdb13 -size 272137 diff --git a/product_docs/docs/net_connector/7.0.4.1/images/dotnet_installation_dialog.png b/product_docs/docs/net_connector/7.0.4.1/images/dotnet_installation_dialog.png deleted file mode 100755 index b465d536032..00000000000 --- a/product_docs/docs/net_connector/7.0.4.1/images/dotnet_installation_dialog.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:994a725f061f1b51fd92ccc2df5abd9066a1cf4ea7600611ae57ebc6cc59af20 -size 51144 diff --git a/product_docs/docs/net_connector/7.0.4.1/images/dotnet_installation_wizard.png b/product_docs/docs/net_connector/7.0.4.1/images/dotnet_installation_wizard.png deleted file mode 100755 index 29c9a7f99f9..00000000000 --- a/product_docs/docs/net_connector/7.0.4.1/images/dotnet_installation_wizard.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:efe8029105db01662005a349a7b59c87b6f7dce3017990a197e3b9b681392860 -size 227235 diff --git a/product_docs/docs/net_connector/7.0.4.1/images/ready_to_install.png b/product_docs/docs/net_connector/7.0.4.1/images/ready_to_install.png deleted file mode 100755 index 59e44d96bc5..00000000000 --- a/product_docs/docs/net_connector/7.0.4.1/images/ready_to_install.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:91b18bef7b78a6dae7d6b664e2bccfbfdb4248dbd034cb59e2c6a35ada7da49c -size 44080 diff --git a/product_docs/docs/net_connector/7.0.4.1/images/selecting_the_connectors_installer.png b/product_docs/docs/net_connector/7.0.4.1/images/selecting_the_connectors_installer.png deleted file mode 100755 index 432e4473c09..00000000000 --- a/product_docs/docs/net_connector/7.0.4.1/images/selecting_the_connectors_installer.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:d939c7e6604025f82be47969d69e6acc63ab5a48a0af4341e42efe0156b42778 -size 97808 diff --git a/product_docs/docs/net_connector/7.0.4.1/images/starting_stackbuilder_plus.png b/product_docs/docs/net_connector/7.0.4.1/images/starting_stackbuilder_plus.png deleted file mode 100755 index 11665300652..00000000000 --- a/product_docs/docs/net_connector/7.0.4.1/images/starting_stackbuilder_plus.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:ce6bcefb865ca14239fb7e0e2ac5149ed56251cfbc5153869070d039f70857c6 -size 91989 diff --git a/product_docs/docs/net_connector/7.0.4.1/index.mdx b/product_docs/docs/net_connector/7.0.4.1/index.mdx deleted file mode 100644 index 12bab6247b1..00000000000 --- a/product_docs/docs/net_connector/7.0.4.1/index.mdx +++ /dev/null @@ -1,20 +0,0 @@ ---- -title: "EDB .NET Connector" -directoryDefaults: - description: "EDB .NET Connector version 7.0.4.1 documentation and release notes." -pdf: true ---- - -The EDB .NET Connector distributed with EDB Postgres Advanced Server provides connectivity between a .NET client application and an EDB Postgres Advanced Server database server. You can: - -- Connect to an instance of EDB Postgres Advanced Server. -- Retrieve information from an EDB Postgres Advanced Server database. -- Update information stored on an EDB Postgres Advanced Server database. - -To understand these examples, you need a solid working knowledge of C# and .NET. The EDB .NET Connector functionality is built on the core functionality of the Npgsql open source project. For details, see the [Npgsql User Guide](http://www.npgsql.org/doc/index.html). - -
- -release_notes requirements_overview the_advanced_server_net_connector_overview installing_and_configuring_the_net_connector using_the_net_connector opening_a_database_connection retrieving_database_records parameterized_queries inserting_records_in_a_database deleting_records_in_a_database using_spl_stored_procedures_in_your_net_application using_advanced_queueing using_a_ref_cursor_in_a_net_application using_plugins using_object_types scram_compatibility advanced_server_net_connector_logging api_reference conclusion - -
diff --git a/product_docs/docs/net_connector/7.0.6.1/02_requirements_overview.mdx b/product_docs/docs/net_connector/7.0.6.1/02_requirements_overview.mdx deleted file mode 100644 index fbd750391e3..00000000000 --- a/product_docs/docs/net_connector/7.0.6.1/02_requirements_overview.mdx +++ /dev/null @@ -1,20 +0,0 @@ ---- -title: "Product compatibility" ---- - - - -These are the supported versions and platforms for the EDB .NET Connector. - -The EDB .NET Connector is certified with EDB Postgres Advanced Server version 11 and later. - -The EDB .NET Connector graphical installers are supported on the following Windows platforms: - -64-bit Windows: - -- Windows Server 2019 and 2022 -- Windows 10 and 11 - -32-bit Windows: - -- Windows 10 diff --git a/product_docs/docs/net_connector/7.0.6.1/03_the_advanced_server_net_connector_overview.mdx b/product_docs/docs/net_connector/7.0.6.1/03_the_advanced_server_net_connector_overview.mdx deleted file mode 100644 index 660a94173a2..00000000000 --- a/product_docs/docs/net_connector/7.0.6.1/03_the_advanced_server_net_connector_overview.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -title: "EDB .NET Connector overview" - ---- - - - -EDB .NET Connector is a .NET data provider that allows a client application to connect to a database stored on an EDB Postgres Advanced Server host. The .NET Connector accesses the data directly, allowing the client application optimal performance, a broad spectrum of functionality, and access to EDB Postgres Advanced Server features. - -The .NET Connector supports the following frameworks: - -- .NET 7.0 -- .NET 6.0 -- .NET Framework 4.7.2, 4.8, and 4.8.1 -- .NET Standard 2.0 and 2.1 - - -## The .NET class hierarchy - -The .NET class hierarchy contains classes that you can use to create objects that control a connection to the EDB Postgres Advanced Server database and manipulate the data stored on the server. The following are a few of the most commonly used object classes. - -`EDBDataSource` - - `EDBDataSource` is the entry point for all the connections made to the database. It's responsible for issuing connections to the server and efficiently managing them. Starting with EDB .NET Connector 7.0.4.1, you no longer need direct instantiation of `EDBConnection`. Instantiate `EDBDataSource` and use the method provided to create commands or execute queries. - -`EDBConnection` - - The `EDBConnection` class represents a connection to EDB Postgres Advanced Server. An `EDBConnection` object contains a `ConnectionString` that tells the .NET client how to connect to an EDB Postgres Advanced Server database. Obtain `EDBConnection` from an `EDBDataSource` instance, and use it directly only in specific scenarios, such as transactions. - -`EDBCommand` - - An `EDBCommand` object contains an SQL command that the client executes against EDB Postgres Advanced Server. Before you can execute an `EDBCommand` object, you must link it to an `EDBConnection` object. - -`EDBDataReader` - - An `EDBDataReader` object provides a way to read an EDB Postgres Advanced Server result set. You can use an `EDBDataReader` object to step through one row at a time, forward only. - -`EDBDataAdapter` - - An `EDBDataAdapter` object links a result set to the EDB Postgres Advanced Server database. You can modify values and use the `EDBDataAdapter` class to update the data stored in an EDB Postgres Advanced Server database. diff --git a/product_docs/docs/net_connector/7.0.6.1/04_installing_and_configuring_the_net_connector.mdx b/product_docs/docs/net_connector/7.0.6.1/04_installing_and_configuring_the_net_connector.mdx deleted file mode 100644 index f7c68f4644a..00000000000 --- a/product_docs/docs/net_connector/7.0.6.1/04_installing_and_configuring_the_net_connector.mdx +++ /dev/null @@ -1,274 +0,0 @@ ---- -title: "Installing and configuring the .NET Connector" - ---- - - - -## Installing the .NET Connector - -You can use the EDB .NET Connector Installer (available [from the EDB website](https://www.enterprisedb.com/software-downloads-postgres)) to add the .NET Connector to your system. - -1. After downloading the installer, right-click the installer icon, and select **Run As Administrator** from the context menu. When prompted, select an installation language and select **OK** to continue to the Setup window. - - ![The .NET Connector Installation wizard](images/dotnet_installation_wizard.png) - -1. Select **Next**. - - ![The Installation dialog box](images/dotnet_installation_dialog.png) - -1. Use the Installation Directory dialog box to specify the directory in which to install the connector. Select **Next**. - - ![The Ready to Install dialog box](images/ready_to_install.png) - -1. To start the installation, on the Ready to Install dialog box, select **Next**. Popups confirm the progress of the installation wizard. - - ![The installation is complete](images/dotnet_installation_complete.png) - -1. When the wizard informs you that it has completed the setup, select **Finish**. - -You can also use StackBuilder Plus to add or update the connector on an existing Advanced Server installation. - -1. To open StackBuilder Plus, from the Windows **Apps** menu, select **StackBuilder Plus**. - - ![Starting StackBuilder Plus](images/starting_stackbuilder_plus.png) - -1. When StackBuilder Plus opens, follow the onscreen instructions. - -1. From the Database Drivers node of the tree control, select the **EnterpriseDB.Net Connector** option. - - ![Selecting the Connectors installer](images/selecting_the_connectors_installer.png) - -1. Follow the directions of the onscreen wizard to add or update an installation of an EDB Connector. - -## Configuring the .NET Connector - -For information about configuring the .NET Connector in each environment, see: - -- **Referencing the Library Files.** [General configuration information](#referencing_the_library_files) applicable to all components. -- **.NET 7.0** Instructions for configuring for use with [.NET 7.0](#setup_7_0) -- **.NET 6.0** Instructions for configuring for use with [.NET 6.0](#setup_6_0). -- **.NET Framework 4.7.2** Instructions for configuring for use with [.NET framework 4.7.2](#net-framework-472). -- **.NET Framework 4.8** Instructions for configuring for use with [.NET Framework 4.8](#net-framework-48). -- **.NET Framework 4.8.1** Instructions for configuring for use with [.NET Framework 4.8.1](#net-framework-481). -- **.NET Standard 2.0** Instructions for configuring for use with [.NET Standard 2.0](#standard_setup_2_0). -- **.NET Standard 2.1** Instructions for configuring for use with [.NET Standard 2.1](#standard_setup_2_1). -- **.NET EntityFramework Core** Instructions for configuring for use with [.NET EntityFramework Core](#entity_setup). - -### Referencing the library files - - - -To reference library files with Microsoft Visual Studio: - -1. Select the project in the Solution Explorer. -2. Select **Project > Add Reference**. -3. In the Add Reference` dialog box, browse to select the appropriate library files. - -Optionally, you can copy the library files to the specified location. - -Before you can use an EDB .NET class, you must import the namespace into your program. Importing a namespace makes the compiler aware of the classes available within the namespace. The namespace is `EnterpriseDB.EDBClient`. - -The method you use to include the namespace varies by the type of application you're writing. For example, the following command imports a namespace into an `ASP.NET` page: - -```text - <% import namespace="EnterpriseDB.EDBClient" %> -``` - -To import a namespace into a C# application, use: - -```text - using EnterpriseDB.EDBClient; -``` - -### .NET framework setup - -Each .NET version has specific setup instructions. - - - -#### .NET 7.0 - -For .NET 7.0, the data provider installation path is `C:\Program Files\edb\dotnet\net7.0\`. - -You must add the following dependencies to your project: - -- `EnterpriseDB.EDBClient.dll` - -Depending on your application type, you might need to import the namespace into the source code. See [Referencing the library files](#referencing_the_library_files) for this and the other information about referencing the library files. - - - -#### .NET 6.0 - -For .NET 6.0, the data provider installation path is: - - `C:\Program Files\edb\dotnet\net6.0\` - -You must add the following dependencies to your project: - -- `EnterpriseDB.EDBClient.dll` - -Depending on your application type, you might need to import the namespace into the source code. See [Referencing the library files](#referencing_the_library_files) for this and the other information about referencing library files. - - - -#### .NET Framework 4.7.2 - -For .NET Framework 4.7.2, the data provider installation path is: - - `C:\Program Files\edb\dotnet\net472\`. - -You must add the following dependency to your project. You may also need to add other dependencies from the same directory: - -- `EnterpriseDB.EDBClient.dll` - -Depending on your application type, you might need to import the namespace into the source code. See Referencing the library files for this and the other information about referencing the library files. - -#### .NET Framework 4.8 - -For .NET Framework 4.8, the data provider installation path is: - - `C:\Program Files\edb\dotnet\net48\`. - -You must add the following dependency to your project. You may also need to add other dependencies from the same directory: - -- `EnterpriseDB.EDBClient.dll` - -Depending on your application type, you might need to import the namespace into the source code. See Referencing the library files for this and the other information about referencing the library files. - -#### .NET Framework 4.8.1 - -For .NET Framework 4.8.1, the data provider installation path is: - - `C:\Program Files\edb\dotnet\net481\`. - -You must add the following dependency to your project. You may also need to add other dependencies from the same directory: - -- `EnterpriseDB.EDBClient.dll` - -Depending on your application type, you might need to import the namespace into the source code. See Referencing the library files for this and the other information about referencing the library files. - - - -#### .NET Standard 2.0 - -For .NET Standard Framework 2.0, the data provider installation path is: - - `C:\Program Files\edb\dotnet\netstandard2.0\`. - -You must add the following dependencies to your project: - -- `EnterpriseDB.EDBClient.dll` - -- `System.Threading.Tasks.Extensions.dll` - -- `System.Runtime.CompilerServices.Unsafe.dll` - -- `System.ValueTuple.dll` - -Depending on your application type, you might need to import the namespace into the source code. See [Referencing the library files](#referencing_the_library_files) for this and the other information about referencing the library files. - - - -#### .NET Standard 2.1 - -For .NET Standard Framework 2.1, the data provider installation path is `C:\Program Files\edb\dotnet\netstandard2.1\`. - -The following shared library files are required: - -- `EnterpriseDB.EDBClient.dll` - -- `System.Memory.dll` - -- `System.Runtime.CompilerServices.Unsafe.dll` - -- `System.Text.Json.dll` - -- `System.Threading.Tasks.Extensions.dll` - -- `System.ValueTuple.dll` - -Depending on your application type, you might need to import the namespace into the source code. See [Referencing the library files](#referencing_the_library_files) for this and the other information about referencing the library files. - - - -#### .NET Entity Framework Core - -To configure the .NET Connector for use with Entity Framework Core, the data provider installation path is either: - -- `C:\Program Files\edb\dotnet\EF.Core\EFCore.PG\net7.0` - -- `C:\Program Files\edb\dotnet\EF.Core\EFCore.PG\net6.0` - -The following shared library file is required: - -- `EnterpriseDB.EDBClient.EntityFrameworkCore.PostgreSQL.dll` - -!!! Note - - You can use Entity Framework Core with the `EnterpriseDB.EDBClient.dll` library available in the `net7.0` or `net6.0` subdirectory. - - -See [Referencing the library files](#referencing_the_library_files) for information about referencing the library files. - -The following NuGet packages are required: - -- `Microsoft.EntityFrameworkCore.Design` - -- `Microsoft.EntityFrameworkCore.Relational` - -- `Microsoft.EntityFrameworkCore.Abstractions` - - -For usage information about Entity Framework Core, see the [Microsoft documentation](https://learn.microsoft.com/en-us/ef/core/). - -**Prerequisite** - -To open a command prompt: - -Select **Tools > Command Line > Developer Command Prompt**. - -Install dotnet-ef (using the command prompt), - - `dotnet tool install --global dotnet-ef` - -**Sample project** - -Create a new Console Application based on .NET 7.0 or .NET 6.0.. - -Add Reference to the following EDB assemblies: - -- `EnterpriseDB.EDBClient.EntityFrameworkCore.PostgreSQL.dll` - -- `EnterpriseDB.EDBClient.dll` - -Add the following NuGet packages: - -- `Microsoft.EntityFrameworkCore.Design` - -- `Microsoft.EntityFrameworkCore.Relational` - -- `Microsoft.EntityFrameworkCore.Abstractions` - -**Database-first scenario** - -Issue the following command to create model classes corresponding to all objects in the specified database: - -```text -dotnet ef dbcontext scaffold Host=;Database=;Username=;Password=;Port= EnterpriseDB.EDBClient.EntityFrameworkCore.PostgreSQL -o Models -``` - -**Code-first scenario** - -Add code for defining a DbContext and create, read, update, and delete operations. - -For further details, see the Microsoft documentation. - -Issue the following commands to create the initial database and tables: - -```text - dotnet ef migrations add InitialCreate --context BloggingContext - - dotnet ef database update --context BloggingContext -``` diff --git a/product_docs/docs/net_connector/7.0.6.1/05_using_the_net_connector.mdx b/product_docs/docs/net_connector/7.0.6.1/05_using_the_net_connector.mdx deleted file mode 100644 index dcdac30a376..00000000000 --- a/product_docs/docs/net_connector/7.0.6.1/05_using_the_net_connector.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -title: "Using the .NET Connector" - ---- - - - -These examples show how you can use the EDB object classes that are provided by the EDB .NET Connector that allow a .NET application to connect to and interact with an EDB Postgres Advanced Server database. - -To use these examples, place the .NET library files in the same directory as the compiled form of your application. All of these examples are written in C#, and each is embedded in an ASP.NET page. The same logic and code applies to other .NET applications (WinForm or console applications, for example). - -Create and save the following `web.config` file in the same directory as the sample code. The examples make use of the `DB_CONN_STRING` key from this configuration file to return a connection string from the EDB Postgres Advanced Server host. - -```text - - - - - - -``` - -An EDB Postgres Advanced Server connection string for an ASP.NET web application is stored in the `web.config` file. If you're writing an application that doesn't use ASP.NET, provide the connection information in an application configuration file such as `app.config`. diff --git a/product_docs/docs/net_connector/7.0.6.1/06_opening_a_database_connection.mdx b/product_docs/docs/net_connector/7.0.6.1/06_opening_a_database_connection.mdx deleted file mode 100644 index 8f5eb142b23..00000000000 --- a/product_docs/docs/net_connector/7.0.6.1/06_opening_a_database_connection.mdx +++ /dev/null @@ -1,278 +0,0 @@ ---- -title: "Opening a database connection" - ---- - - - -An `EDBConnection` object is responsible for handling the communication between an instance of EDB Postgres Advanced Server and a .NET application. Before you can access data stored in an EDB Postgres Advanced Server database, you must create and open an `EDBConnection` object. - -## Creating an EDBConnection object - -You can open a connection using one of the following approaches. In either case, you must import the namespace `EnterpriseDB.EDBClient`. - -### Connection with a data source - -1. Create an instance of the `EDBDataSource` object using a connection string as a parameter to the create method of the `EDBDataSource` class. - -2. Call the `OpenConnection` method of the `EDBDataSource` object to open a connection. - -This example shows how to open a connection using a data source: - - ```text - await using var dataSource = EDBDataSource.Create(ConnectionString); - var connection = dataSource.OpenConnection(); - ``` - -### Connection without a data source - -1. Create an instance of the `EDBConnection` object using a connection string as a parameter to the constructor of the `EDBConnection` class. - -2. Call the `Open` method of the `EDBConnection` object to open the connection. - -This example shows how to open a connection without a data source: - - ```text - EDBConnection conn = new EDBConnection(ConnectionString); - conn.Open(); - ``` - -!!! Note - For `EnterpriseDB.EDBClient 7.0.4` and later, we recommend `EDBDataSource` to connect to EDB Postgres Advanced Server database or execute SQL directly against it. For more information on data source, see the [Npgsql documentation](https://www.npgsql.org/doc/basic-usage.html). - - - - -## Connection string parameters - -A valid connection string specifies location and authentication information for an EDB Postgres Advanced Server instance. You must provide the connection string before opening the connection. A connection string must contain: - -- The name or IP address of the server -- The name of the EDB Postgres Advanced Server database -- The name of an EDB Postgres Advanced Server user -- The password associated with that user - -You can include the following parameters in the connection string: - -`CommandTimeout` - - `CommandTimeout` specifies the length of time (in seconds) to wait for a command to finish executing before throwing an exception. The default value is `20`. - -`ConnectionLifeTime` - - Use `ConnectionLifeTime` to specify the length of time (in seconds) to wait before closing unused connections in the pool. The default value is `15`. - -`Database` - - Use the `Database` parameter to specify the name of the database for the application to connect to. The default is the name of the connecting user. - -`Encoding` - - The `Encoding` parameter is obsolete. The parameter always returns the string `unicode` and silently ignores attempts to set it. - -`Integrated Security` - - Specify a value of `true` to use Windows Integrated Security. By default, `Integrated Security` is set to `false`, and Windows Integrated Security is disabled. - -`Load Role Based Tables` - - Use `Load Role Based Tables` to load table OIDs based on role. This change affects only the loading of table type OID and not the composite type. Setting this parameter to `true` triggers the new functionality. The default value is `false`. - -`MaxPoolSize` - - `MaxPoolSize` instructs `EDBConnection` to dispose of pooled connections when the pool exceeds the specified number of connections. The default value is `20`. - -`MinPoolSize` - - `MinPoolSize` instructs `EDBConnection` to preallocate the specified number of connections with the server. The default value is `1`. - -`Password` - - When using clear text authentication, specify the password to use to establish a connection with the server. - -`Pooling` - - Specify a value of `false` to disable connection pooling. By default, `Pooling` is set to `true` to enable connection pooling. - -`No Reset On Close` - -When `Pooling` is enabled and the connection is closed, reopened, and the underlying connection is reused, then some operations are executed to discard the previous connection resources. You can override this behavior by enabling `No Reset On Close`. - -`Port` - - The `Port` parameter specifies the port for the application to connect to. - -`Protocol` - - The specific protocol version to use (instead of automatic). Specify an integer value of `2` or `3`. - -`SearchPath` - - Use the `SearchPath` parameter to change the search path to named and public schemas. - -`Server` - - The name or IP address of the EDB Postgres Advanced Server host. - -`SSL` - - Specify a value of `true` to attempt a secure connection. By default, `SSL` is set to `false`. - -`sslmode` - - Use `sslmode` to specify an SSL connection control preference. `sslmode` can be: - -- `prefer` — Use SSL if possible. - -- `require` — Throw an exception if an SSL connection can't be established. - -- `allow` — Connect without SSL. This parameter isn't supported. - -- `disable` — Don't attempt an SSL connection. This is the default behavior. - -`SyncNotification` - - Use the `SyncNotification` parameter to specify for `EDBDataprovider` to use synchronous notifications. The default value is `false`. - -`Timeout` - - `Timeout` specifies the length of time (in seconds) to wait for an open connection. The default value is `15`. - -`User Id` - - The `User Id` parameter specifies the user name to use for the connection. - -## Example: Opening a database connection using ASP.NET - -This example shows how to open a connection to an instance of EDB Postgres Advanced Server and then close the connection. The connection is established using the credentials specified in the `DB_CONN_STRING` configuration parameter. See [Using the .Net Connector](05_using_the_net_connector/#using_the_net_connector) for an introduction to connection information. Also see [Connection string parameters](#connection-string-parameters) for connection parameters. - -```cpp -<% @ Page Language="C#" %> -<% @Import Namespace="EnterpriseDB.EDBClient" %> -<% @Import Namespace="System.Configuration" %> - -``` - -If the connection is successful, a message appears indicating that the connection opened successfully. - -## Example: Opening a database connection from a console application - -This example opens a connection with an EDB Postgres Advanced Server database using a console-based application. - -Before writing the code for the console application, create an `app.config` file that stores the connection string to the database. Using a configuration file makes it convenient to update the connection string if the information changes. - -```ini - - - - - - -``` - -Enter the following code sample into a file: - -```csharp -using System; -using System.Data; -using EnterpriseDB.EDBClient; -using System.Configuration; -namespace EnterpriseDB -{ - class EDB - { - static void Main(string[] args) - { - var strConnectionString = ConfigurationManager.AppSettings["DB_CONN_STRING"]; - try - { - await using var dataSource = EDBDataSource.Create(strConnectionString); - var conn = dataSource.OpenConnection(); - Console.WriteLine("Connection Opened Successfully"); - conn.Close(); - } - catch(Exception exp) - { - throw new Exception(exp.ToString()); - } - } - } -} -``` - -Save the file as `EDBConnection-Sample.cs` and compile it with the following command: - -```text -csc /r:EnterpriseDB.EDBClient.dll /out:Console.exe EDBConnection-Sample.cs` -``` - -Compiling the sample generates a `Console.exe` file. You can execute the sample code by entering `Console.exe`. When executed, the console verifies that it opened successfully. - -## Example: Opening a database connection from a Windows form application - -This example opens a database connection using a .NET WinForm application. To use the example, save the following code as `WinForm-Example.cs` in a directory that contains the library files. - -```csharp -using System; -using System.Windows.Forms; -using System.Drawing; -using EnterpriseDB.EDBClient; -namespace EDBTestClient -{ - class Win_Conn - { - static void Main(string[] args) - { - Form frmMain = new Form(); - Button btnConn = new Button(); - btnConn.Location = new System.Drawing.Point(104, 64); - btnConn.Name = "btnConn"; - btnConn.Text = "Open Connection"; - btnConn.Click += new System.EventHandler(btnConn_Click); - frmMain.Controls.Add(btnConn); - frmMain.Text = "EnterpriseDB"; - Application.Run(frmMain); - } - private static void btnConn_Click(object sender, System.EventArgs e) - { - try - { - var strConnectionString = "Server=localhost;port=5444;username=edb;password=edb;database=edb"; - await using var dataSource = EDBDataSource.Create(strConnectionString); - var conn = dataSource.OpenConnection(); - MessageBox.Show("Connection Opened Successfully"); - conn.Close(); - } - catch(EDBException exp) - { - MessageBox.Show(exp.ToString()); - } - } - } -} -``` - -Change the database connection string to point to the database that you want to connect to. Then compile the file with the following command: - -```text -csc /r:EnterpriseDB.EDBClient.dll /out:WinForm.exe WinForm-Example.cs -``` - -This command generates a `WinForm.exe` file in the same folder that the executable was compiled under. Invoking the executable displays a message that the connection was successful. diff --git a/product_docs/docs/net_connector/7.0.6.1/07_retrieving_database_records.mdx b/product_docs/docs/net_connector/7.0.6.1/07_retrieving_database_records.mdx deleted file mode 100644 index c8c7cc6fb3a..00000000000 --- a/product_docs/docs/net_connector/7.0.6.1/07_retrieving_database_records.mdx +++ /dev/null @@ -1,102 +0,0 @@ ---- -title: "Retrieving database records" - ---- - - - -You can use a `SELECT` statement to retrieve records from the database using a `SELECT` command. To execute a `SELECT` statement you must: - -- Create and open a database connection. -- Create an `EDBCommand` object that represents the `SELECT` statement. -- Execute the command with the `ExecuteReader()` method of the `EDBCommand` object returning `EDBDataReader`. -- Loop through the `EDBDataReader`, displaying the results or binding the `EDBDataReader` to some control. - -An `EDBDataReader` object represents a forward-only and read-only stream of database records, presented one record at a time. To view a subsequent record in the stream, you must call the `Read()` method of the `EDBDataReader` object. - -The example that follows: - -1. Imports the EDB Postgres Advanced Server namespace `EnterpriseDB.EDBClient`. -2. Initializes an `EDBCommand` object with a `SELECT` statement. -3. Opens a connection to the database. -4. Executes the `EDBCommand` by calling the `ExecuteReader` method of the `EDBCommand` object. - -The results of the SQL statement are retrieved into an `EDBDataReader` object. - -Loop through the contents of the `EDBDataReader` object to display the records returned by the query in a `WHILE` loop. - -The `Read()` method advances to the next record (if there is one) and returns `true` if a record exists. It returns `false` if `EDBDataReader` has reached the end of the result set. - -```cpp -<% @ Page Language="C#" %> -<% @Import Namespace="EnterpriseDB.EDBClient" %> -<% @Import Namespace="System.Data" %> -<% @Import Namespace="System.Configuration" %> - - -``` - -To exercise the sample code, save the code in your default web root directory in a file named `selectEmployees.aspx`. Then, to invoke the program, enter the following URL in a browser: `http://localhost/selectEmployees.aspx`. - -## Retrieving a single database record - -To retrieve a single result from a query, use the `ExecuteScalar()` method of the `EDBCommand` object. The `ExecuteScalar()` method returns the first value of the first column of the first row of the `DataSet` generated by the specified query. - -```cpp -<% @ Page Language="C#" %> -<% @Import Namespace="EnterpriseDB.EDBClient" %> -<% @Import Namespace="System.Data" %> -<% @Import Namespace="System.Configuration" %> - -``` - -Save the sample code in a file named `selectscalar.aspx` in a web root directory. - -To invoke the sample code, enter the following in a browser: `http://localhost/selectScalar.aspx` - -The sample includes an explicit conversion of the value returned by the `ExecuteScalar()` method. The `ExecuteScalar()` method returns an object. To view the object, you must convert it to an integer value by using the `Convert.ToInt32` method. diff --git a/product_docs/docs/net_connector/7.0.6.1/08_parameterized_queries.mdx b/product_docs/docs/net_connector/7.0.6.1/08_parameterized_queries.mdx deleted file mode 100644 index c6e393c296f..00000000000 --- a/product_docs/docs/net_connector/7.0.6.1/08_parameterized_queries.mdx +++ /dev/null @@ -1,47 +0,0 @@ ---- -title: "Parameterized queries" - ---- - - - -A _parameterized query_ is a query with one or more parameter markers embedded in the SQL statement. Before executing a parameterized query, you must supply a value for each marker found in the text of the SQL statement. - -Parameterized queries are useful when you don't know the complete text of a query when you write your code. For example, the value referenced in a `WHERE` clause can be calculated from user input. - -As shown in the following example, you must declare the data type of each parameter specified in the parameterized query by creating an `EDBParameter` object and adding that object to the command's parameter collection. Then, you must specify a value for each parameter by calling the parameter's `Value()` function. - -The example shows using a parameterized query with an `UPDATE` statement that increases an employee salary: - -```cpp -<% @ Page Language="C#" Debug="true"%> -<% @Import Namespace="EnterpriseDB.EDBClient" %> -<% @Import Namespace="System.Data" %> -<% @Import Namespace="System.Configuration" %> - -``` - -Save the sample code in a file named `updateSalary.aspx` in a web root directory. - -To invoke the sample code, enter the following in a browser: `http://localhost/updateSalary.aspx` diff --git a/product_docs/docs/net_connector/7.0.6.1/09_inserting_records_in_a_database.mdx b/product_docs/docs/net_connector/7.0.6.1/09_inserting_records_in_a_database.mdx deleted file mode 100644 index 228224eb3b8..00000000000 --- a/product_docs/docs/net_connector/7.0.6.1/09_inserting_records_in_a_database.mdx +++ /dev/null @@ -1,47 +0,0 @@ ---- -title: "Inserting records in a database" - ---- - - - -You can use the `ExecuteNonQuery()` method of `EDBCommand` to add records to a database stored on an EDB Postgres Advanced Server host with an `INSERT` command. - -In the example that follows, the `INSERT` command is stored in the variable `cmd`. The values prefixed with a colon (`:`) are placeholders for `EDBParameters` that are instantiated, assigned values, and then added to the `INSERT` command's parameter collection in the statements that follow. The `INSERT` command is executed by the `ExecuteNonQuery()` method of the `cmdInsert` object. - -The example adds an employee to the `emp` table: - -```cpp -<% @ Page Language="C#" Debug="true"%> -<% @Import Namespace="EnterpriseDB.EDBClient" %> -<% @Import Namespace="System.Data" %> -<% @Import Namespace="System.Configuration" %> - -``` - -Save the sample code in a file named `insertEmployee.aspx` in a web root directory. - -To invoke the sample code, enter the following in a browser: `http://localhost/insertEmployee.aspx` diff --git a/product_docs/docs/net_connector/7.0.6.1/10_deleting_records_in_a_database.mdx b/product_docs/docs/net_connector/7.0.6.1/10_deleting_records_in_a_database.mdx deleted file mode 100644 index 8c797af0868..00000000000 --- a/product_docs/docs/net_connector/7.0.6.1/10_deleting_records_in_a_database.mdx +++ /dev/null @@ -1,44 +0,0 @@ ---- -title: "Deleting records in a database" - ---- - - - -You can use the `ExecuteNonQuery()` method of `EDBCommand` to delete records from a database stored on an EDB Postgres Advanced Server host with a `DELETE` statement. - -In the example that follows, the `DELETE` command is stored in the variable `strDeleteQuery`. The code passes the employee number specified by `EmpNo` to the `DELETE` command. The command is then executed using the `ExecuteNonQuery()` method. - -```cpp -<% @ Page Language="C#" Debug="true"%> -<% @Import Namespace="EnterpriseDB.EDBClient" %> -<% @Import Namespace="System.Data" %> -<% @Import Namespace="System.Configuration" %> - -``` - -Save the sample code in a file named `deleteEmployee.aspx` in a web root directory. - -To invoke the sample code, enter the following in a browser: `http://localhost/deleteEmployee.aspx` diff --git a/product_docs/docs/net_connector/7.0.6.1/11_using_spl_stored_procedures_in_your_net_application.mdx b/product_docs/docs/net_connector/7.0.6.1/11_using_spl_stored_procedures_in_your_net_application.mdx deleted file mode 100644 index 51a2c02f6f6..00000000000 --- a/product_docs/docs/net_connector/7.0.6.1/11_using_spl_stored_procedures_in_your_net_application.mdx +++ /dev/null @@ -1,340 +0,0 @@ ---- -title: "Using SPL stored procedures in your .NET application" - ---- - - - -You can include SQL statements in an application in two ways: - -- By adding the SQL statements directly in the .NET application code -- By packaging the SQL statements in a stored procedure and executing the stored procedure from the .NET application - -In some cases, a stored procedure can provide advantages over embedded SQL statements. Stored procedures support complex conditional and looping constructs that are difficult to duplicate with SQL statements embedded directly in an application. - -You can also see an improvement in performance by using stored procedures. A stored procedure needs to be parsed, compiled, and optimized only once on the server side. A SQL statement that's included in an application might be parsed, compiled, and optimized each time it's executed from a .NET application. - -To use a stored procedure in your .NET application you must: - -1. Create an SPL stored procedure on the EDB Postgres Advanced Server host. -2. Import the `EnterpriseDB.EDBClient` namespace. -3. Pass the name of the stored procedure to the instance of the `EDBCommand`. -4. Change the `EDBCommand.CommandType` to `CommandType.StoredProcedure`. -5. `Prepare()` the command. -6. Execute the command. - -## Example: Executing a stored procedure without parameters - -This sample procedure prints the name of department 10. The procedure takes no parameters and returns no parameters. To create the sample procedure, invoke EDB-PSQL and connect to the EDB Postgres Advanced Server host database. Enter the following SPL code at the command line: - -```sql -CREATE OR REPLACE PROCEDURE list_dept10 -IS - v_deptname VARCHAR2(30); -BEGIN - DBMS_OUTPUT.PUT_LINE('Dept No: 10'); - SELECT dname INTO v_deptname FROM dept WHERE deptno = 10; - DBMS_OUTPUT.PUT_LINE('Dept Name: ' || v_deptname); -END; -``` - -When EDB Postgres Advanced Server validates the stored procedure, it echoes `CREATE PROCEDURE`. - -### Using the EDBCommand object to execute a stored procedure - -The `CommandType` property of the `EDBCommand` object indicates the type of command being executed. The `CommandType` property is set to one of three possible `CommandType` enumeration values: - -- Use the default `Text` value when passing a SQL string for execution. -- Use the `StoredProcedure` value, passing the name of a stored procedure for execution. -- Use the `TableDirect` value when passing a table name. This value passes back all records in the specified table. - -The `CommandText` property must contain a SQL string, stored procedure name, or table name, depending on the value of the `CommandType` property. - -The following example executes the stored procedure: - -```cpp -<% @ Page Language="C#" Debug="true"%> -<% @Import Namespace="EnterpriseDB.EDBClient" %> -<% @Import Namespace="System.Data" %> -<% @Import Namespace="System.Configuration" %> - -``` - -Save the sample code in a file named `storedProc.aspx` in a web root directory. - -To invoke the sample code, enter the following in a browser: `http://localhost/storedProc.aspx` - -## Example: Executing a stored procedure with IN parameters - -This example calls a stored procedure that includes `IN` parameters. To create the sample procedure, invoke EDB-PSQL and connect to the EDB Postgres Advanced Server host database. Enter the following SPL code at the command line: - -```sql -CREATE OR REPLACE PROCEDURE - EMP_INSERT - ( - pENAME IN VARCHAR, - pJOB IN VARCHAR, - pSAL IN FLOAT4, - pCOMM IN FLOAT4, - pDEPTNO IN INTEGER, - pMgr IN INTEGER - ) -AS -DECLARE - CURSOR TESTCUR IS SELECT MAX(EMPNO) FROM EMP; - MAX_EMPNO INTEGER := 10; -BEGIN - - OPEN TESTCUR; - FETCH TESTCUR INTO MAX_EMPNO; - INSERT INTO EMP(EMPNO,ENAME,JOB,SAL,COMM,DEPTNO,MGR) - VALUES(MAX_EMPNO+1,pENAME,pJOB,pSAL,pCOMM,pDEPTNO,pMgr); - CLOSE testcur; -END; - -``` - -When EDB Postgres Advanced Server validates the stored procedure, it echoes `CREATE PROCEDURE`. - -### Passing input values to a stored procedure - -Calling a stored procedure that contains parameters is similar to executing a stored procedure without parameters. The major difference is that, when calling a parameterized stored procedure, you must use the `EDBParameter` collection of the `EDBCommand` object. When the `EDBParameter` is added to the `EDBCommand` collection, properties such as `ParameterName`, `DbType`, `Direction`, `Size`, and `Value` are set. - -This example shows the process of executing a parameterized stored procedure from a C# script: - -```cpp -<% @ Page Language="C#" Debug="true"%> -<% @Import Namespace="EnterpriseDB.EDBClient" %> -<% @Import Namespace="System.Data" %> -<% @Import Namespace="System.Configuration" %> - -``` - -Save the sample code in a file named `storedProcInParam.aspx` in a web root directory. - -To invoke the sample code, enter the following in a browser: `http://localhost/storedProcInParam.aspx` - -In the example, the body of the `Page_Load` method declares and instantiates an `EDBConnection` object. The sample then creates an `EDBCommand` object with the properties needed to execute the stored procedure. - -The example then uses the `Add` method of the `EDBCommand Parameter` collection to add six input parameters. - -```cpp -EDBCommand cmdStoredProc = new EDBCommand -("emp_insert(:EmpName,:Job,:Salary,:Commission,:DeptNo,:Manager)",conn); -cmdStoredProc.CommandType = CommandType.StoredProcedure; -``` - -It assigns a value to each parameter before passing them to the `EMP_INSERT` stored procedure. - -The `Prepare()` method prepares the statement before calling the `ExecuteNonQuery()` method. - -The `ExecuteNonQuery` method of the `EDBCommand` object executes the stored procedure. After the stored procedure executes, a test record is inserted into the `emp` table, and the values inserted are displayed on the web page. - -## Example: Executing a stored procedure with IN, OUT, and INOUT parameters - -The previous example showed how to pass `IN` parameters to a stored procedure. The following examples show how to pass `IN` values and return `OUT` values from a stored procedure. - -### Creating the stored procedure - -The following stored procedure passes the department number and returns the corresponding location and department name. To create the sample procedure, invoke EDB-PSQL and connect to the EDB Postgres Advanced Server host database. Enter the following SPL code at the command line: - -```sql -CREATE OR REPLACE PROCEDURE - DEPT_SELECT - ( - pDEPTNO IN INTEGER, - pDNAME OUT VARCHAR, - pLOC OUT VARCHAR - ) -AS -DECLARE - CURSOR TESTCUR IS SELECT DNAME,LOC FROM DEPT; - REC RECORD; -BEGIN - - OPEN TESTCUR; - FETCH TESTCUR INTO REC; - - pDNAME := REC.DNAME; - pLOC := REC.LOC; - - CLOSE testcur; -END; -``` - -When EDB Postgres Advanced Server validates the stored procedure, it echoes `CREATE PROCEDURE`. - -### Receiving output values from a stored procedure - -When retrieving values from `OUT` parameters, you must explicitly specify the direction of those parameters as `Output`. You can retrieve the values from `Output` parameters in two ways: - -- Call the `ExecuteReader` method of the `EDBCommand` and explicitly loop through the returned `EDBDataReader`, searching for the values of `OUT` parameters. -- Call the `ExecuteNonQuery` method of `EDBCommand` and explicitly get the value of a declared `Output` parameter by calling that `EDBParameter` value property. - -In each method, you must declare each parameter, indicating the direction of the parameter (`ParameterDirection.Input`, `ParameterDirection.Output`, or `ParameterDirection.InputOutput`). Before invoking the procedure, you must provide a value for each `IN` and `INOUT` parameter. After the procedure returns, you can retrieve the `OUT` and `INOUT` parameter values from the `command.Parameters[]` array. - -This code shows using the `ExecuteReader` method to retrieve a result set: - -```cpp -<% @ Page Language="C#" Debug="true"%> -<% @Import Namespace="EnterpriseDB.EDBClient" %> -<% @Import Namespace="System.Data" %> -<% @Import Namespace="System.Configuration" %> - -``` - -This code shows using the `ExecuteNonQuery` method to retrieve a result set: - -```cpp -<% @ Page Language="C#" Debug="true"%> -<% @Import Namespace="EnterpriseDB.EDBClient" %> -<% @Import Namespace="System.Data" %> -<% @Import Namespace="System.Configuration" %> - -``` diff --git a/product_docs/docs/net_connector/7.0.6.1/12_using_advanced_queueing.mdx b/product_docs/docs/net_connector/7.0.6.1/12_using_advanced_queueing.mdx deleted file mode 100644 index d50395d0e8f..00000000000 --- a/product_docs/docs/net_connector/7.0.6.1/12_using_advanced_queueing.mdx +++ /dev/null @@ -1,492 +0,0 @@ ---- -title: "Using advanced queueing" - ---- - - - -EDB Postgres Advanced Server advanced queueing provides message queueing and message processing for the EDB Postgres Advanced Server database. User-defined messages are stored in a queue. A collection of queues is stored in a queue table. Create a queue table before creating a queue that depends on it. - -On the server side, procedures in the `DBMS_AQADM` package create and manage message queues and queue tables. Use the `DBMS_AQ` package to add messages to or remove messages from a queue or register or unregister a PL/SQL callback procedure. For more information about `DBMS_AQ` and `DBMS_AQADM`, see [DBMS_AQ](/epas/latest/reference/oracle_compatibility_reference/epas_compat_bip_guide/03_built-in_packages/02_dbms_aq/). - -On the client side, the application uses the EDB.NET driver to enqueue and dequeue messages. - -## Enqueueing or dequeueing a message - -For more information about using EDB Postgres Advanced Server's advanced queueing functionality, see [Built-in packages](/epas/latest/reference/oracle_compatibility_reference/epas_compat_bip_guide/). - -### Server-side setup - -To use advanced queueing functionality on your .NET application, you must first create a user-defined type, queue table, and queue, and then start the queue on the database server. Invoke EDB-PSQL and connect to the EDB Postgres Advanced Server host database. Use the following SPL commands at the command line: - -#### Creating a user-defined type - -To specify a RAW data type, create a user-defined type. This example shows creating a user-defined type named as `myxml`: - -``` -CREATE TYPE myxml AS (value XML); -``` - -#### Creating the queue table - -A queue table can hold multiple queues with the same payload type. This example shows creating a table named `MSG_QUEUE_TABLE`: - -```Text -EXEC DBMS_AQADM.CREATE_QUEUE_TABLE - (queue_table => 'MSG_QUEUE_TABLE', - queue_payload_type => 'myxml', - comment => 'Message queue table'); -END; -``` - -#### Creating the queue - -This example shows creating a queue named `MSG_QUEUE` in the table `MSG_QUEUE_TABLE`: - -```Text -BEGIN -DBMS_AQADM.CREATE_QUEUE ( queue_name => 'MSG_QUEUE', queue_table => 'MSG_QUEUE_TABLE', comment => 'This queue contains pending messages.'); -END; -``` - -**Starting the queue** - -Once the queue is created, invoke the following SPL code at the command line to start a queue in the EDB database: - -```Text -BEGIN -DBMS_AQADM.START_QUEUE -(queue_name => 'MSG_QUEUE'); -END; -``` - -### Client-side example - -Once you've created a user-defined type, followed by queue table and queue, start the queue. Then, you can enqueue or dequeue a message using EDB .Net drivers. - -#### Enqueue a message - -To enqueue a message on your .NET application, you must: - -1. Import the `EnterpriseDB.EDBClient` namespace. -2. Pass the name of the queue and create the instance of the `EDBAQQueue`. -3. Create the enqueue message and define a payload. -4. Call the `queue.Enqueue` method. - -The following code shows using the `queue.Enqueue` method. - -!!! Note - This code creates the message and serializes it. This is example code and doesn't compile if copied as it is. You must serialize the message as XML. - -```Text -using EnterpriseDB.EDBClient; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace AQXml -{ - class MyXML - { - public string value { get; set; } - } - class Program - { - static void Main(string[] args) - { - int messagesToSend = 1; - if (args.Length > 0 && !string.IsNullOrEmpty(args[0])) - { - messagesToSend = int.Parse(args[0]); - } - for (int i = 0; i < 5; i++) - { - EnqueMsg("test message: " + i); - } - } - - private static EDBConnection GetConnection() - { - string connectionString = "Server=127.0.0.1;Host=127.0.0.1;Port=5444;User Id=enterprisedb;Password=test;Database=edb;Timeout=999"; - EDBConnection connection = new EDBConnection(connectionString); - connection.Open(); - return connection; - } - - - private static string ByteArrayToString(byte[] byteArray) - { - // Sanity check if it's null so we don't incur overhead of an exception - if (byteArray == null) - { - return string.Empty; - } - try - { - StringBuilder hex = new StringBuilder(byteArray.Length * 2); - foreach (byte b in byteArray) - { - hex.AppendFormat("{0:x2}", b); - } - - return hex.ToString().ToUpper(); - } - catch - { - return string.Empty; - } - } - - private static bool EnqueMsg(string msg) - { - EDBConnection con = GetConnection(); - using (EDBAQQueue queue = new EDBAQQueue("MSG_QUEUE", con)) - { - queue.MessageType = EDBAQMessageType.Xml; - EDBTransaction txn = queue.Connection.BeginTransaction(); - QueuedEntities.Message queuedMessage = new QueuedEntities.Message() { MessageText = msg }; - - try - { - string rootElementName = queuedMessage.GetType().Name; - if (rootElementName.IndexOf(".") != -1) - { - rootElementName = rootElementName.Split('.').Last(); - } - - string xml = new Utils.XmlFragmentSerializer().Serialize(queuedMessage); - EDBAQMessage queMsg = new EDBAQMessage(); - queMsg.Payload = new MyXML { value = xml }; - queue.MessageType = EDBAQMessageType.Udt; - queue.UdtTypeName = "myxml"; - EDBConnection.GlobalTypeMapper.MapComposite("myxml"); - con.ReloadTypes(); - queue.Enqueue(queMsg); - var messageId = ByteArrayToString((byte[])queMsg.MessageId); - Console.WriteLine("MessageID: " + messageId); - txn.Commit(); - queMsg = null; - xml = null; - rootElementName = null; - return true; - } - catch (Exception ex) - { - txn?.Rollback(); - Console.WriteLine("Failed to enqueue message."); - Console.WriteLine(ex.ToString()); - return false; - } - finally - { - queue?.Connection?.Dispose(); - } - } - } - - } -} -``` - -#### Dequeueing a message - -To dequeue a message on your .NET application, you must: - -1. Import the `EnterpriseDB.EDBClient` namespace. -2. Pass the name of the queue and create the instance of the `EDBAQQueue`. -3. Call the `queue.Dequeue` method. - -!!! Note - The following code creates the message and serializes it. This is example code and doesn't compile if copied as it is. You must serialize the message as XML. - -```Text -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using EnterpriseDB.EDBClient; - -namespace DequeueXML -{ - class MyXML - { - public string value { get; set; } - } - class Program - { - static void Main(string[] args) - { - DequeMsg(); - } - - - private static EDBConnection GetConnection() - { - string connectionString = "Server=127.0.0.1;Host=127.0.0.1;Port=5444;User Id=enterprisedb;Password=test;Database=edb;Timeout=999"; - EDBConnection connection = new EDBConnection(connectionString); - connection.Open(); - return connection; - } - - - private static string ByteArrayToString(byte[] byteArray) - { - // Sanity check if it's null so we don't incur overhead of an exception - if (byteArray == null) - { - return string.Empty; - } - try - { - StringBuilder hex = new StringBuilder(byteArray.Length * 2); - foreach (byte b in byteArray) - { - hex.AppendFormat("{0:x2}", b); - } - - return hex.ToString().ToUpper(); - } - catch - { - return string.Empty; - } - } - public static void DequeMsg(int waitTime = 10) - { - EDBConnection con = GetConnection(); - using (EDBAQQueue queueListen = new EDBAQQueue("MSG_QUEUE", con)) - { - queueListen.UdtTypeName = "myxml"; - queueListen.DequeueOptions.Navigation = EDBAQNavigationMode.FIRST_MESSAGE; - queueListen.DequeueOptions.Visibility = EDBAQVisibility.ON_COMMIT; - queueListen.DequeueOptions.Wait = 1; - EDBTransaction txn = null; - - while (1 == 1) - { - - if (queueListen.Connection.State == System.Data.ConnectionState.Closed) - { - queueListen.Connection.Open(); - } - - string messageId = "Unknown"; - try - { - // the listen function is a blocking function. It will Wait the specified waitTime or until a - // message is received. - Console.WriteLine("Listening..."); - string v = queueListen.Listen(null, waitTime); - // If we are waiting for a message and we specify a Wait time, - // then if there are no more messages, we want to just bounce out. - if (waitTime > -1 && v == null) - { - Console.WriteLine("No message received during Wait period."); - Console.WriteLine(); - continue; - } - - // once we're here that means a message has been detected in the queue. Let's deal with it. - txn = queueListen.Connection.BeginTransaction(); - - Console.WriteLine("Attempting to dequeue message..."); - // dequeue the message - EDBAQMessage deqMsg; - try - { - deqMsg = queueListen.Dequeue(); - } - catch (Exception ex) - { - if (ex.Message.Contains("ORA-25228")) - { - Console.WriteLine("Message was not there. Another process must have picked it up."); - Console.WriteLine(); - txn.Rollback(); - continue; - } - else - { - throw; - } - } - - messageId = ByteArrayToString((byte[])deqMsg.MessageId); - if (deqMsg != null) - { - Console.WriteLine("Processing received message..."); - // process the message payload - MyXML obj = (MyXML) deqMsg.Payload; - - QueuedEntities.Message msg = new Utils.XmlFragmentSerializer().Deserialize(obj.value); - - Console.WriteLine("Received Message:"); - Console.WriteLine("MessageID: " + messageId); - Console.WriteLine("Message: " + msg.MessageText); - Console.WriteLine("Enqueue Time" + queueListen.MessageProperties.EnqueueTime); - - txn.Commit(); - - Console.WriteLine("Finished processing message"); - Console.WriteLine(); - - } - else - { - Console.WriteLine("Message was not dequeued."); - } - } - catch (Exception ex) - { - Console.WriteLine("Failed To dequeue or process the dequeued message."); - Console.WriteLine(ex.ToString()); - Console.WriteLine(); - if (txn != null) - { - txn.Rollback(); - if (txn != null) - { - txn.Dispose(); - } - } - } - } - } - - } - } -} -``` - -## EDBAQ classes - -The following EDBAQ classes are used in this application. - -### EDBAQDequeueMode - -The `EDBAQDequeueMode` class lists all the dequeuer modes available. - -| Value | Description | -| ------------- | ------------------------------------------------------------- | -| Browse | Reads the message without locking. | -| Locked | Reads and gets a write lock on the message. | -| Remove | Deletes the message after reading. This is the default value. | -| Remove_NoData | Confirms receipt of the message. | - -### EDBAQDequeueOptions - -The `EDBAQDequeueOptions` class lists the options available when dequeuing a message. - -| Property | Description | -| -------------- | ------------------------------------------------------------------------------------------------------------------------------ | -| ConsumerName | The name of the consumer for which to dequeue the message. | -| DequeueMode | Set from `EDBAQDequeueMode`. It represents the locking behavior linked with the dequeue option. | -| Navigation | Set from `EDBAQNavigationMode`. It represents the position of the message to fetch. | -| Visibility | Set from `EDBAQVisibility`. It represents whether the new message is dequeued as part of the current transaction. | -| Wait | The wait time for a message as per the search criteria. | -| Msgid | The message identifier. | -| Correlation | The correlation identifier. | -| DeqCondition | The dequeuer condition. It's a Boolean expression. | -| Transformation | The transformation to apply before dequeuing the message. | -| DeliveryMode | The delivery mode of the dequeued message. | - -### EDBAQEnqueueOptions - -The `EDBAQEnqueueOptions` class lists the options available when enqueuing a message. - -| Property | Description | -| ----------------- | ------------------------------------------------------------------------------------------------------------------------------ | -| Visibility | Set from `EDBAQVisibility`. It represents whether the new message is enqueued as part of the current transaction. | -| RelativeMsgid | The relative message identifier. | -| SequenceDeviation | The sequence when to dequeue the message. | -| Transformation | The transformation to apply before enqueuing the message. | -| DeliveryMode | The delivery mode of the enqueued message. | - -### EDBAQMessage - -The `EDBAQMessage` class lists a message to enqueue/dequeue. - -| Property | Description | -| ------------ | -------------------------------- | -| Payload | The actual message to queue. | -| MessageId | The ID of the queued message. | - -### EDBAQMessageProperties - -The `EDBAQMessageProperties` lists the message properties available. - -| Property | Description | -| ---------------- | --------------------------------------------------------------------------------------------- | -| Priority | The priority of the message. | -| Delay | The duration after which the message is available for dequeuing, in seconds. | -| Expiration | The duration for which the message is available for dequeuing, in seconds. | -| Correlation | The correlation identifier. | -| Attempts | The number of attempts taken to dequeue the message. | -| RecipientList | The recipients list that overthrows the default queue subscribers. | -| ExceptionQueue | The name of the queue to move the unprocessed messages to. | -| EnqueueTime | The time when the message was enqueued. | -| State | The state of the message while dequeued. | -| OriginalMsgid | The message identifier in the last queue. | -| TransactionGroup | The transaction group for the dequeued messages. | -| DeliveryMode | The delivery mode of the dequeued message. | - -### EDBAQMessageState - -The `EDBAQMessageState` class represents the state of the message during dequeue. - -| Value | Description | -| --------- | --------------------------------------------------------- | -| Expired | The message is moved to the exception queue. | -| Processed | The message is processed and kept. | -| Ready | The message is ready to be processed. | -| Waiting | The message is in waiting state. The delay isn't reached. | - -### EDBAQMessageType - -The `EDBAQMessageType` class represents the types for payload. - -| Value | Description | -| --------- | ------------------------------------------------------------------------------------- | -| Raw | The raw message type.

Note: Currently, this payload type isn't supported. | -| UDT | The user-defined type message. | -| XML | The XML type message.

Note: Currently, this payload type isn't supported. | - -### EDBAQNavigationMode - -The `EDBAQNavigationMode` class represents the different types of navigation modes available. - -| Value | Description | -| ---------------- | ------------------------------------------------------------------ | -| First_Message | Returns the first available message that matches the search terms. | -| Next_Message | Returns the next available message that matches the search items. | -| Next_Transaction | Returns the first message of next transaction group. | - -### EDBAQQueue - -The `EDBAQQueue` class represents a SQL statement to execute `DMBS_AQ` functionality on a PostgreSQL database. - -| Property | Description | -| ----------------- | --------------------------------------------------------------------------------------------- | -| Connection | The connection to use. | -| Name | The name of the queue. | -| MessageType | The message type that's enqueued/dequeued from this queue, for example `EDBAQMessageType.Udt`. | -| UdtTypeName | The user-defined type name of the message type. | -| EnqueueOptions | The enqueue options to use. | -| DequeuOptions | The dequeue options to use. | -| MessageProperties | The message properties to use. | - -### EDBAQVisibility - -The `EDBAQVisibility` class represents the visibility options available. - -| Value | Description | -| --------- | ----------------------------------------------------------- | -| Immediate | The enqueue/dequeue isn't part of the ongoing transaction. | -| On_Commit | The enqueue/dequeue is part of the current transaction. | - -!!! Note - - To review the default options for these parameters, see [DBMS_AQ](../../epas/11/epas_compat_bip_guide/03_built-in_packages/02_dbms_aq/). - - EDB advanced queueing functionality uses user-defined types for calling enqueue/dequeue operations. `Server Compatibility Mode=NoTypeLoading` can't be used with advanced queueing because `NoTypeLoading` doesn't load any user-defined types. diff --git a/product_docs/docs/net_connector/7.0.6.1/13_using_a_ref_cursor_in_a_net_application.mdx b/product_docs/docs/net_connector/7.0.6.1/13_using_a_ref_cursor_in_a_net_application.mdx deleted file mode 100644 index 3b77d3f4ba8..00000000000 --- a/product_docs/docs/net_connector/7.0.6.1/13_using_a_ref_cursor_in_a_net_application.mdx +++ /dev/null @@ -1,104 +0,0 @@ ---- -title: "Using a ref cursor in a .NET application" - ---- - - - -A `ref cursor` is a cursor variable that contains a pointer to a query result set. The result set is determined by executing the `OPEN FOR` statement using the cursor variable. A cursor variable isn't tied to a particular query like a static cursor. You can open the same cursor variable a number of times with the `OPEN FOR` statement containing different queries and each time. A new result set is created for that query and made available by way of the cursor variable. You can declare a cursor variable in two ways: - -- Use the `SYS_REFCURSOR` built-in data type to declare a weakly typed ref cursor. -- Define a strongly typed ref cursor that declares a variable of that type. - -`SYS_REFCURSOR` is a ref cursor type that allows any result set to be associated with it. This is known as a weakly typed ref cursor. The following example is a declaration of a weakly typed ref cursor: - -``` - name SYS_REFCURSOR`; -``` - -Following is an example of a strongly typed ref cursor: - -``` -TYPE IS REF CURSOR RETURN emp%ROWTYPE`; -``` - -## Creating the stored procedure - -This sample code creates a stored procedure called `refcur_inout_callee`. It specifies the data type of the ref cursor being passed as an OUT parameter. To create the sample procedure, invoke EDB-PSQL and connect to the EDB Postgres Advanced Server host database. Enter the following SPL code at the command line: - -```sql -CREATE OR REPLACE PROCEDURE - refcur_inout_callee(v_refcur OUT SYS_REFCURSOR) -IS -BEGIN - OPEN v_refcur FOR SELECT ename FROM emp; -END; -``` - -This C# code uses the stored procedure to retrieve employee names from the `emp` table: - -```cpp -using System; -using System.Data; -using EnterpriseDB.EDBClient; -using System.Configuration; -namespace EDBRefCursor -{ - class EmpRefcursor - { - [STAThread] - static void Main(string[] args) - { - var strConnectionString = - ConfigurationManager.AppSettings["DB_CONN_STRING"]; - try - { - await using var dataSource = EDBDataSource.Create(ConnectionString); - var conn = await dataSource.OpenConnectionAsync(); - await using var tran = await connection.BeginTransactionAsync(); - using var command = new EDBCommand("refcur_inout_callee", conn); - command.CommandType = CommandType.StoredProcedure; - command.Transaction = tran; - command.Parameters.Add(new EDBParameter("refCursor", - EDBTypes.EDBDbType.Refcursor, 10, "refCursor", - ParameterDirection.Output, false, 2, 2, - System.Data.DataRowVersion.Current, null)); - await command.PrepareAsync(); - command.Parameters[0].Value = null; - await command.ExecuteNonQueryAsync(); - var cursorName = command.Parameters[0].Value.ToString(); - command.CommandText = "fetch all in \"" + cursorName + "\""; - command.CommandType = CommandType.Text; - await using var reader = - await command.ExecuteReaderAsync(CommandBehavior.SequentialAccess); - var fc = reader.FieldCount; - while (await reader.ReadAsync()) - { - for (int i = 0; i < fc; i++) - { - Console.WriteLine(reader.GetString(i)); - } - } - await reader.CloseAsync(); - await tran.CommitAsync(); - await conn.CloseAsync(); - } - catch (Exception ex) - { - Console.WriteLine(ex.Message.ToString()); - } - } - } -} -``` - -This .NET code snippet displays the result on the console: - -```cpp -for(int i = 0;i < fc; i++) -{ - Console.WriteLine(reader.GetString(i)); -} -``` - -You must bind the `EDBDbType.RefCursor` type in `EDBParameter()` if you're using a ref cursor parameter. diff --git a/product_docs/docs/net_connector/7.0.6.1/14_using_plugins.mdx b/product_docs/docs/net_connector/7.0.6.1/14_using_plugins.mdx deleted file mode 100644 index 9e8a3b1389e..00000000000 --- a/product_docs/docs/net_connector/7.0.6.1/14_using_plugins.mdx +++ /dev/null @@ -1,72 +0,0 @@ ---- -title: "Using plugins" - ---- - - - -EDB .Net driver plugins support the enhanced capabilities for different data types that are otherwise not available in .Net. The different plugins available support: - -- GeoJSON -- Json.NET -- NetTopologySuite -- NodaTime - -The plugins support the use of spatial, data/time, and JSON types. The following are the supported frameworks and data provider installation path for these plugins. - -## GeoJSON - -If you're using the GeoJSON plugin on .NET Standard 2.0, the data provider installation paths are: - -- `C:\Program Files\edb\dotnet\plugins\GeoJSON\netstandard2.0` -- `C:\Program Files\edb\dotnet\plugins\GeoJSON\net472` -- `C:\Program Files\edb\dotnet\plugins\GeoJSON\net48` -- `C:\Program Files\edb\dotnet\plugins\GeoJSON\net481` - -The following shared library files are required: - -- `EnterpriseDB.EDBClient.GeoJSON.dll` - -For detailed information about using the GeoJSON plugin, see the [Npgsql documentation](http://www.npgsql.org/doc/types/geojson.html). - -## Json.NET - -If you're using the Json.NET plugin on .NET Standard 2.0, the data provider installation paths are: -- `C:\Program Files\edb\dotnet\plugins\Json.NET\netstandard2.0` -- `C:\Program Files\edb\dotnet\plugins\Json.NET\net472` -- `C:\Program Files\edb\dotnet\plugins\Json.NET\net48` -- `C:\Program Files\edb\dotnet\plugins\Json.NET\net481` - -The following shared library files are required: - -- `EnterpriseDB.EDBClient.Json.NET.dll` - -For detailed information about using the Json.NET plugin, see the [Npgsql documentation](http://www.npgsql.org/doc/types/jsonnet.html). - -## NetTopologySuite - -If you're using the NetTopologySuite plugin on .Net Standard 2.0, the data provider installation paths are: -- `C:\Program Files\edb\dotnet\plugins\NetTopologySuite\netstandard2.0` -- `C:\Program Files\edb\dotnet\plugins\NetTopologySuite\net472` -- `C:\Program Files\edb\dotnet\plugins\NetTopologySuite\net48` -- `C:\Program Files\edb\dotnet\plugins\NetTopologySuite\net481` - -The following shared library files are required: - -- `EnterpriseDB.EDBClient.NetTopologySuite.dll` - -For detailed information about using the NetTopologySuite type plugin, see the [Npgsql documentation](http://www.npgsql.org/doc/types/nts.html). - -## NodaTime - -If you're using the NodaTime plugin on .Net Standard 2.0, the data provider installation paths are: -- `C:\Program Files\edb\dotnet\plugins\NodaTime\netstandard2.0` -- `C:\Program Files\edb\dotnet\plugins\NodaTime\net472` -- `C:\Program Files\edb\dotnet\plugins\NodaTime\net48` -- `C:\Program Files\edb\dotnet\plugins\NodaTime\net481` - -The following shared library files are required: - -- `EnterpriseDB.EDBClient.NodaTime.dll` - -For detailed information about using the NodaTime plugin, see the [Npgsql documentation](http://www.npgsql.org/doc/types/nodatime.html). diff --git a/product_docs/docs/net_connector/7.0.6.1/15_using_object_types.mdx b/product_docs/docs/net_connector/7.0.6.1/15_using_object_types.mdx deleted file mode 100644 index c57c5ba4713..00000000000 --- a/product_docs/docs/net_connector/7.0.6.1/15_using_object_types.mdx +++ /dev/null @@ -1,181 +0,0 @@ ---- -title: "Using object types in .NET" - ---- - - - -The SQL `CREATE TYPE` command creates a user-defined object type, which is stored in the EDB Postgres Advanced Server database. You can then reference these user-defined types in SPL procedures, SPL functions, and .NET programs. - -Create the basic object type with the `CREATE TYPE AS OBJECT` command. Optionally, use the `CREATE TYPE BODY` command. - -## Using an object type - -To use an object type, you must first create the object type in the EDB Postgres Advanced Server database. Object type `addr_object_type` defines the attributes of an address: - -```text -CREATE OR REPLACE TYPE addr_object_type AS OBJECT -( - street VARCHAR2(30), - city VARCHAR2(20), - state CHAR(2), - zip NUMBER(5) -); -``` - -Object type `emp_obj_typ` defines the attributes of an employee. One of these attributes is object type `ADDR_OBJECT_TYPE`, as previously described. The object type body contains a method that displays the employee information: - -```text -CREATE OR REPLACE TYPE emp_obj_typ AS OBJECT -( - empno NUMBER(4), - ename VARCHAR2(20), - addr ADDR_OBJECT_TYPE, - MEMBER PROCEDURE display_emp(SELF IN OUT emp_obj_typ) -); - -CREATE OR REPLACE TYPE BODY emp_obj_typ AS - MEMBER PROCEDURE display_emp (SELF IN OUT emp_obj_typ) - IS - BEGIN - DBMS_OUTPUT.PUT_LINE('Employee No : ' || SELF.empno); - DBMS_OUTPUT.PUT_LINE('Name : ' || SELF.ename); - DBMS_OUTPUT.PUT_LINE('Street : ' || SELF.addr.street); - DBMS_OUTPUT.PUT_LINE('City/State/Zip: ' || SELF.addr.city || ', ' || - SELF.addr.state || ' ' || LPAD(SELF.addr.zip,5,'0')); - END; -END; -``` - -This example is a complete .NET program that uses these user-defined object types: - -```text -using EnterpriseDB.EDBClient; -using System.Data.Common; -namespace TypesTest -{ - internal class Program - { - static async Task Main(string[] args) - { - var connString = "Server=localhost;Port=5444;database=edb;User ID=enterprisedb;password=edb;"; - var dataSourceBuilder = new EDBDataSourceBuilder(connString); - dataSourceBuilder.MapComposite("enterprisedb.addr_object_type"); - dataSourceBuilder.MapComposite("enterprisedb.emp_obj_typ"); - await using var dataSource = dataSourceBuilder.Build(); - await using var conn = await dataSource.OpenConnectionAsync(); - try - { - var address = new addr_object_type() - { - street = "123 MAIN STREET", - city = "EDISON", - state = "NJ", - zip = 8817 - }; - var emp = new emp_obj_typ() - { - empno = 9001, - ename = "JONES", - addr = address - }; - await using (var cmd = new EDBCommand("emp_obj_typ.display_emp", conn)) - { - cmd.CommandType = System.Data.CommandType.StoredProcedure; - EDBCommandBuilder.DeriveParameters(cmd); - cmd.Parameters[0].Value = emp; - cmd.Prepare(); - cmd.ExecuteNonQuery(); - var empOut = (emp_obj_typ?)cmd.Parameters[0].Value; - Console.WriteLine("Emp No: " + empOut.empno); - Console.WriteLine("Emp Name: " + empOut.ename); - Console.WriteLine("Emp Address Street: " + empOut.addr.street); - Console.WriteLine("Emp Address City: " + empOut.addr.city); - Console.WriteLine("Emp Address State: " + empOut.addr.state); - Console.WriteLine("Emp Address Zip: " + empOut.addr.zip); - Console.WriteLine("Emp No: " + empOut.empno); - } - } - catch (EDBException exp) - { - Console.WriteLine(exp.Message.ToString()); - } - finally - { - conn.Close(); - } - } - } -public class addr_object_type - { - public string? street; - public string? city; - public string? state; - public decimal zip; - } - public class emp_obj_typ - { - public decimal empno; - public string? ename; - public addr_object_type? addr; - } -} -``` - -The following .NET types are defined to map to the types in EDB Postgres Advanced Server: - -```text -public class addr_object_type -{ -public string? street; -public string? city; -public string? state; -public decimal zip; -} - -public class emp_obj_typ -{ - public decimal empno; - public string? ename; - public addr_object_type? addr; -} -``` - -A call to `EDBDataSourceBuilder.MapComposite` maps the .NET type to the EDB Postgres Advanced Server types: - -```text -dataSourceBuilder.MapComposite("enterprisedb.addr_object_type"); -dataSourceBuilder.MapComposite("enterprisedb.emp_obj_typ"); -``` - -A call to `EDBCommandBuilder.DeriveParameters()` gets parameter information for a stored procedure. This allows you to just set the parameter values and call the stored procedure: - -```text -EDBCommandBuilder.DeriveParameters(cmd); -``` - -Set the value of the parameter by creating an object of the .NET type and assigning it to the `Value` property of the parameter: - -```text -addr_object_type address = new addr_object_type() -{ - street = "123 MAIN STREET", - city = "EDISON", - state = "NJ", - zip = 8817 -}; - -emp_obj_typ emp = new emp_obj_typ() -{ - empno = 9001, - ename = "JONES", - addr = address -}; -cmd.Parameters[0].Value = emp; -``` - -A call to `cmd.ExecuteNonQuery()` executes the call to the `display_emp()` method: - -```text -cmd.ExecuteNonQuery(); -``` diff --git a/product_docs/docs/net_connector/7.0.6.1/16_scram_compatibility.mdx b/product_docs/docs/net_connector/7.0.6.1/16_scram_compatibility.mdx deleted file mode 100644 index feff2da342b..00000000000 --- a/product_docs/docs/net_connector/7.0.6.1/16_scram_compatibility.mdx +++ /dev/null @@ -1,10 +0,0 @@ ---- -title: "Scram compatibility" -legacyRedirects: - - "/edb-docs/d/edb-postgres-net-connector/user-guides/net-guide/4.1.6.1/security_and_encryption.html" - ---- - - - -The EDB .NET driver provides SCRAM-SHA-256 support for EDB Postgres Advanced Server version 10 and later. This support is available from EDB .NET 4.0.2.1 release and later. diff --git a/product_docs/docs/net_connector/7.0.6.1/17_advanced_server_net_connector_logging.mdx b/product_docs/docs/net_connector/7.0.6.1/17_advanced_server_net_connector_logging.mdx deleted file mode 100644 index 03bd1ed820a..00000000000 --- a/product_docs/docs/net_connector/7.0.6.1/17_advanced_server_net_connector_logging.mdx +++ /dev/null @@ -1,82 +0,0 @@ ---- -title: "EDB .NET Connector logging" - ---- - - - -EDB .NET Connector supports the use of logging to help resolve issues with the .NET Connector when used in your application. EDB .NET Connector supports logging using the standard .NET `Microsoft.Extensions.Logging` package. For more information about logging in .Net, see [Logging in C# and .NET](https://learn.microsoft.com/en-us/dotnet/core/extensions/logging?tabs=command-line). - -!!! Note - For versions earlier than 7.x, EDB .NET Connector had its own, custom logging API. - -## Console logging provider - -.NET logging API works with a variety of built-in and third-party logging providers. The console logging provider logs output to the console. - -### Console logging with EDBDataSource - -Create a `Microsoft.Extensions.Logging.LoggerFactory` and configure an `EDBDataSource` with it. Any use of connections opened through this data source log using this logger factory. - -```text -var loggerFactory = LoggerFactory.Create(builder => builder.AddSimpleConsole()); - -var dataSourceBuilder = new EDBDataSourceBuilder(connectionString); -dataSourceBuilder.UseLoggerFactory(loggerFactory); -await using var dataSource = dataSourceBuilder.Build(); - -await using var connection = await dataSource.OpenConnectionAsync(); -await using var command = new EDBCommand("SELECT 1", connection); -_ = await command.ExecuteScalarAsync(); -``` - -### Console logging without EDBDataSource - -Create a `Microsoft.Extensions.Logging.LoggerFactory` and configure EDB .NET Connector's logger factory globally using `EDBLoggingConfiguration.InitializeLogging`. Configure it at the start of your program, before using any other EDB .NET Connector API. - -```text -var loggerFactory = LoggerFactory.Create(builder => builder.AddSimpleConsole()); -EDBLoggingConfiguration.InitializeLogging(loggerFactory); - -await using var conn = new EDBConnection(connectionString); -await conn.OpenAsync(); -await using var command = new EDBCommand("SELECT 1", conn); -_ = await command.ExecuteScalarAsync(); -``` - -## Log levels - -The following log levels are available: - -- Trace -- Debug -- Information -- Warning -- Error -- Fatal - -This example shows how to change the log level to `Trace`: - -```text -var loggerFactory = LoggerFactory.Create(builder => builder -.SetMinimumLevel(LogLevel.Trace -.AddSimpleConsole() -); -``` - -## Formatting the log output - -This example shows how to format your log output. Create a `LoggerFactory` to restrict each log message to a single line and add a date time to the log: - -```text -var loggerFactory = LoggerFactory.Create(builder => -builder -.SetMinimumLevel(LogLevel.Trace) -.AddSimpleConsole( - options => - { - options.SingleLine = true; - options.TimestampFormat = "yyyy/MM/dd HH:mm:ss "; - } - )); -``` \ No newline at end of file diff --git a/product_docs/docs/net_connector/7.0.6.1/18_api_reference.mdx b/product_docs/docs/net_connector/7.0.6.1/18_api_reference.mdx deleted file mode 100644 index 53050c37952..00000000000 --- a/product_docs/docs/net_connector/7.0.6.1/18_api_reference.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -title: "API reference" - ---- - - - -For information about using the API, see the [Npgsql documentation](http://www.npgsql.org/doc/api/Npgsql.html). - -Usage notes: - -- When using the API, replace references to `Npgsql` with `EnterpriseDB.EDBClient`. -- When referring to classes, replace `Npgsql` with `EDB`. For example, use the `EDBBinaryExporter` class instead of the `NpgsqlBinaryExporter` class. diff --git a/product_docs/docs/net_connector/7.0.6.1/images/connection_opened_successfully.png b/product_docs/docs/net_connector/7.0.6.1/images/connection_opened_successfully.png deleted file mode 100755 index bab12126d20..00000000000 --- a/product_docs/docs/net_connector/7.0.6.1/images/connection_opened_successfully.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:537e7edecce3882b794110e0ffc644a51cab69ba2c7e7f82a3e99d32c4b4ba65 -size 22683 diff --git a/product_docs/docs/net_connector/7.0.6.1/images/dialog.png b/product_docs/docs/net_connector/7.0.6.1/images/dialog.png deleted file mode 100755 index 19cba54d1f9..00000000000 --- a/product_docs/docs/net_connector/7.0.6.1/images/dialog.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:f922e6cd4e43927708b5f460f5389a5b3a41dd70f3a5394723e6aee7d710f1ae -size 9048 diff --git a/product_docs/docs/net_connector/7.0.6.1/images/dotnet_installation_complete.png b/product_docs/docs/net_connector/7.0.6.1/images/dotnet_installation_complete.png deleted file mode 100755 index 332ae795899..00000000000 --- a/product_docs/docs/net_connector/7.0.6.1/images/dotnet_installation_complete.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:0983f216ce071f57f7e758980c3f966caded4312412905a6aba66efa362fdb13 -size 272137 diff --git a/product_docs/docs/net_connector/7.0.6.1/images/dotnet_installation_dialog.png b/product_docs/docs/net_connector/7.0.6.1/images/dotnet_installation_dialog.png deleted file mode 100755 index b465d536032..00000000000 --- a/product_docs/docs/net_connector/7.0.6.1/images/dotnet_installation_dialog.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:994a725f061f1b51fd92ccc2df5abd9066a1cf4ea7600611ae57ebc6cc59af20 -size 51144 diff --git a/product_docs/docs/net_connector/7.0.6.1/images/dotnet_installation_wizard.png b/product_docs/docs/net_connector/7.0.6.1/images/dotnet_installation_wizard.png deleted file mode 100755 index 29c9a7f99f9..00000000000 --- a/product_docs/docs/net_connector/7.0.6.1/images/dotnet_installation_wizard.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:efe8029105db01662005a349a7b59c87b6f7dce3017990a197e3b9b681392860 -size 227235 diff --git a/product_docs/docs/net_connector/7.0.6.1/images/ready_to_install.png b/product_docs/docs/net_connector/7.0.6.1/images/ready_to_install.png deleted file mode 100755 index 59e44d96bc5..00000000000 --- a/product_docs/docs/net_connector/7.0.6.1/images/ready_to_install.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:91b18bef7b78a6dae7d6b664e2bccfbfdb4248dbd034cb59e2c6a35ada7da49c -size 44080 diff --git a/product_docs/docs/net_connector/7.0.6.1/images/selecting_the_connectors_installer.png b/product_docs/docs/net_connector/7.0.6.1/images/selecting_the_connectors_installer.png deleted file mode 100755 index 432e4473c09..00000000000 --- a/product_docs/docs/net_connector/7.0.6.1/images/selecting_the_connectors_installer.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:d939c7e6604025f82be47969d69e6acc63ab5a48a0af4341e42efe0156b42778 -size 97808 diff --git a/product_docs/docs/net_connector/7.0.6.1/images/starting_stackbuilder_plus.png b/product_docs/docs/net_connector/7.0.6.1/images/starting_stackbuilder_plus.png deleted file mode 100755 index 11665300652..00000000000 --- a/product_docs/docs/net_connector/7.0.6.1/images/starting_stackbuilder_plus.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:ce6bcefb865ca14239fb7e0e2ac5149ed56251cfbc5153869070d039f70857c6 -size 91989 diff --git a/product_docs/docs/net_connector/7.0.6.1/index.mdx b/product_docs/docs/net_connector/7.0.6.1/index.mdx deleted file mode 100644 index b163617fbcf..00000000000 --- a/product_docs/docs/net_connector/7.0.6.1/index.mdx +++ /dev/null @@ -1,20 +0,0 @@ ---- -title: "EDB .NET Connector" -directoryDefaults: - description: "EDB .NET Connector version 7.0.6.1 documentation and release notes." -pdf: true ---- - -The EDB .NET Connector distributed with EDB Postgres Advanced Server provides connectivity between a .NET client application and an EDB Postgres Advanced Server database server. You can: - -- Connect to an instance of EDB Postgres Advanced Server. -- Retrieve information from an EDB Postgres Advanced Server database. -- Update information stored on an EDB Postgres Advanced Server database. - -To understand these examples, you need a solid working knowledge of C# and .NET. The EDB .NET Connector functionality is built on the core functionality of the Npgsql open source project. For details, see the [Npgsql User Guide](http://www.npgsql.org/doc/index.html). - -
- -release_notes requirements_overview the_advanced_server_net_connector_overview installing_and_configuring_the_net_connector using_the_net_connector opening_a_database_connection retrieving_database_records parameterized_queries inserting_records_in_a_database deleting_records_in_a_database using_spl_stored_procedures_in_your_net_application using_advanced_queueing using_a_ref_cursor_in_a_net_application using_plugins using_object_types scram_compatibility advanced_server_net_connector_logging api_reference conclusion - -
diff --git a/product_docs/docs/net_connector/7.0.6.2/02_requirements_overview.mdx b/product_docs/docs/net_connector/7.0.6.2/02_requirements_overview.mdx deleted file mode 100644 index fbd750391e3..00000000000 --- a/product_docs/docs/net_connector/7.0.6.2/02_requirements_overview.mdx +++ /dev/null @@ -1,20 +0,0 @@ ---- -title: "Product compatibility" ---- - - - -These are the supported versions and platforms for the EDB .NET Connector. - -The EDB .NET Connector is certified with EDB Postgres Advanced Server version 11 and later. - -The EDB .NET Connector graphical installers are supported on the following Windows platforms: - -64-bit Windows: - -- Windows Server 2019 and 2022 -- Windows 10 and 11 - -32-bit Windows: - -- Windows 10 diff --git a/product_docs/docs/net_connector/7.0.6.2/03_the_advanced_server_net_connector_overview.mdx b/product_docs/docs/net_connector/7.0.6.2/03_the_advanced_server_net_connector_overview.mdx deleted file mode 100644 index 660a94173a2..00000000000 --- a/product_docs/docs/net_connector/7.0.6.2/03_the_advanced_server_net_connector_overview.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -title: "EDB .NET Connector overview" - ---- - - - -EDB .NET Connector is a .NET data provider that allows a client application to connect to a database stored on an EDB Postgres Advanced Server host. The .NET Connector accesses the data directly, allowing the client application optimal performance, a broad spectrum of functionality, and access to EDB Postgres Advanced Server features. - -The .NET Connector supports the following frameworks: - -- .NET 7.0 -- .NET 6.0 -- .NET Framework 4.7.2, 4.8, and 4.8.1 -- .NET Standard 2.0 and 2.1 - - -## The .NET class hierarchy - -The .NET class hierarchy contains classes that you can use to create objects that control a connection to the EDB Postgres Advanced Server database and manipulate the data stored on the server. The following are a few of the most commonly used object classes. - -`EDBDataSource` - - `EDBDataSource` is the entry point for all the connections made to the database. It's responsible for issuing connections to the server and efficiently managing them. Starting with EDB .NET Connector 7.0.4.1, you no longer need direct instantiation of `EDBConnection`. Instantiate `EDBDataSource` and use the method provided to create commands or execute queries. - -`EDBConnection` - - The `EDBConnection` class represents a connection to EDB Postgres Advanced Server. An `EDBConnection` object contains a `ConnectionString` that tells the .NET client how to connect to an EDB Postgres Advanced Server database. Obtain `EDBConnection` from an `EDBDataSource` instance, and use it directly only in specific scenarios, such as transactions. - -`EDBCommand` - - An `EDBCommand` object contains an SQL command that the client executes against EDB Postgres Advanced Server. Before you can execute an `EDBCommand` object, you must link it to an `EDBConnection` object. - -`EDBDataReader` - - An `EDBDataReader` object provides a way to read an EDB Postgres Advanced Server result set. You can use an `EDBDataReader` object to step through one row at a time, forward only. - -`EDBDataAdapter` - - An `EDBDataAdapter` object links a result set to the EDB Postgres Advanced Server database. You can modify values and use the `EDBDataAdapter` class to update the data stored in an EDB Postgres Advanced Server database. diff --git a/product_docs/docs/net_connector/7.0.6.2/04_installing_and_configuring_the_net_connector.mdx b/product_docs/docs/net_connector/7.0.6.2/04_installing_and_configuring_the_net_connector.mdx deleted file mode 100644 index f7c68f4644a..00000000000 --- a/product_docs/docs/net_connector/7.0.6.2/04_installing_and_configuring_the_net_connector.mdx +++ /dev/null @@ -1,274 +0,0 @@ ---- -title: "Installing and configuring the .NET Connector" - ---- - - - -## Installing the .NET Connector - -You can use the EDB .NET Connector Installer (available [from the EDB website](https://www.enterprisedb.com/software-downloads-postgres)) to add the .NET Connector to your system. - -1. After downloading the installer, right-click the installer icon, and select **Run As Administrator** from the context menu. When prompted, select an installation language and select **OK** to continue to the Setup window. - - ![The .NET Connector Installation wizard](images/dotnet_installation_wizard.png) - -1. Select **Next**. - - ![The Installation dialog box](images/dotnet_installation_dialog.png) - -1. Use the Installation Directory dialog box to specify the directory in which to install the connector. Select **Next**. - - ![The Ready to Install dialog box](images/ready_to_install.png) - -1. To start the installation, on the Ready to Install dialog box, select **Next**. Popups confirm the progress of the installation wizard. - - ![The installation is complete](images/dotnet_installation_complete.png) - -1. When the wizard informs you that it has completed the setup, select **Finish**. - -You can also use StackBuilder Plus to add or update the connector on an existing Advanced Server installation. - -1. To open StackBuilder Plus, from the Windows **Apps** menu, select **StackBuilder Plus**. - - ![Starting StackBuilder Plus](images/starting_stackbuilder_plus.png) - -1. When StackBuilder Plus opens, follow the onscreen instructions. - -1. From the Database Drivers node of the tree control, select the **EnterpriseDB.Net Connector** option. - - ![Selecting the Connectors installer](images/selecting_the_connectors_installer.png) - -1. Follow the directions of the onscreen wizard to add or update an installation of an EDB Connector. - -## Configuring the .NET Connector - -For information about configuring the .NET Connector in each environment, see: - -- **Referencing the Library Files.** [General configuration information](#referencing_the_library_files) applicable to all components. -- **.NET 7.0** Instructions for configuring for use with [.NET 7.0](#setup_7_0) -- **.NET 6.0** Instructions for configuring for use with [.NET 6.0](#setup_6_0). -- **.NET Framework 4.7.2** Instructions for configuring for use with [.NET framework 4.7.2](#net-framework-472). -- **.NET Framework 4.8** Instructions for configuring for use with [.NET Framework 4.8](#net-framework-48). -- **.NET Framework 4.8.1** Instructions for configuring for use with [.NET Framework 4.8.1](#net-framework-481). -- **.NET Standard 2.0** Instructions for configuring for use with [.NET Standard 2.0](#standard_setup_2_0). -- **.NET Standard 2.1** Instructions for configuring for use with [.NET Standard 2.1](#standard_setup_2_1). -- **.NET EntityFramework Core** Instructions for configuring for use with [.NET EntityFramework Core](#entity_setup). - -### Referencing the library files - - - -To reference library files with Microsoft Visual Studio: - -1. Select the project in the Solution Explorer. -2. Select **Project > Add Reference**. -3. In the Add Reference` dialog box, browse to select the appropriate library files. - -Optionally, you can copy the library files to the specified location. - -Before you can use an EDB .NET class, you must import the namespace into your program. Importing a namespace makes the compiler aware of the classes available within the namespace. The namespace is `EnterpriseDB.EDBClient`. - -The method you use to include the namespace varies by the type of application you're writing. For example, the following command imports a namespace into an `ASP.NET` page: - -```text - <% import namespace="EnterpriseDB.EDBClient" %> -``` - -To import a namespace into a C# application, use: - -```text - using EnterpriseDB.EDBClient; -``` - -### .NET framework setup - -Each .NET version has specific setup instructions. - - - -#### .NET 7.0 - -For .NET 7.0, the data provider installation path is `C:\Program Files\edb\dotnet\net7.0\`. - -You must add the following dependencies to your project: - -- `EnterpriseDB.EDBClient.dll` - -Depending on your application type, you might need to import the namespace into the source code. See [Referencing the library files](#referencing_the_library_files) for this and the other information about referencing the library files. - - - -#### .NET 6.0 - -For .NET 6.0, the data provider installation path is: - - `C:\Program Files\edb\dotnet\net6.0\` - -You must add the following dependencies to your project: - -- `EnterpriseDB.EDBClient.dll` - -Depending on your application type, you might need to import the namespace into the source code. See [Referencing the library files](#referencing_the_library_files) for this and the other information about referencing library files. - - - -#### .NET Framework 4.7.2 - -For .NET Framework 4.7.2, the data provider installation path is: - - `C:\Program Files\edb\dotnet\net472\`. - -You must add the following dependency to your project. You may also need to add other dependencies from the same directory: - -- `EnterpriseDB.EDBClient.dll` - -Depending on your application type, you might need to import the namespace into the source code. See Referencing the library files for this and the other information about referencing the library files. - -#### .NET Framework 4.8 - -For .NET Framework 4.8, the data provider installation path is: - - `C:\Program Files\edb\dotnet\net48\`. - -You must add the following dependency to your project. You may also need to add other dependencies from the same directory: - -- `EnterpriseDB.EDBClient.dll` - -Depending on your application type, you might need to import the namespace into the source code. See Referencing the library files for this and the other information about referencing the library files. - -#### .NET Framework 4.8.1 - -For .NET Framework 4.8.1, the data provider installation path is: - - `C:\Program Files\edb\dotnet\net481\`. - -You must add the following dependency to your project. You may also need to add other dependencies from the same directory: - -- `EnterpriseDB.EDBClient.dll` - -Depending on your application type, you might need to import the namespace into the source code. See Referencing the library files for this and the other information about referencing the library files. - - - -#### .NET Standard 2.0 - -For .NET Standard Framework 2.0, the data provider installation path is: - - `C:\Program Files\edb\dotnet\netstandard2.0\`. - -You must add the following dependencies to your project: - -- `EnterpriseDB.EDBClient.dll` - -- `System.Threading.Tasks.Extensions.dll` - -- `System.Runtime.CompilerServices.Unsafe.dll` - -- `System.ValueTuple.dll` - -Depending on your application type, you might need to import the namespace into the source code. See [Referencing the library files](#referencing_the_library_files) for this and the other information about referencing the library files. - - - -#### .NET Standard 2.1 - -For .NET Standard Framework 2.1, the data provider installation path is `C:\Program Files\edb\dotnet\netstandard2.1\`. - -The following shared library files are required: - -- `EnterpriseDB.EDBClient.dll` - -- `System.Memory.dll` - -- `System.Runtime.CompilerServices.Unsafe.dll` - -- `System.Text.Json.dll` - -- `System.Threading.Tasks.Extensions.dll` - -- `System.ValueTuple.dll` - -Depending on your application type, you might need to import the namespace into the source code. See [Referencing the library files](#referencing_the_library_files) for this and the other information about referencing the library files. - - - -#### .NET Entity Framework Core - -To configure the .NET Connector for use with Entity Framework Core, the data provider installation path is either: - -- `C:\Program Files\edb\dotnet\EF.Core\EFCore.PG\net7.0` - -- `C:\Program Files\edb\dotnet\EF.Core\EFCore.PG\net6.0` - -The following shared library file is required: - -- `EnterpriseDB.EDBClient.EntityFrameworkCore.PostgreSQL.dll` - -!!! Note - - You can use Entity Framework Core with the `EnterpriseDB.EDBClient.dll` library available in the `net7.0` or `net6.0` subdirectory. - - -See [Referencing the library files](#referencing_the_library_files) for information about referencing the library files. - -The following NuGet packages are required: - -- `Microsoft.EntityFrameworkCore.Design` - -- `Microsoft.EntityFrameworkCore.Relational` - -- `Microsoft.EntityFrameworkCore.Abstractions` - - -For usage information about Entity Framework Core, see the [Microsoft documentation](https://learn.microsoft.com/en-us/ef/core/). - -**Prerequisite** - -To open a command prompt: - -Select **Tools > Command Line > Developer Command Prompt**. - -Install dotnet-ef (using the command prompt), - - `dotnet tool install --global dotnet-ef` - -**Sample project** - -Create a new Console Application based on .NET 7.0 or .NET 6.0.. - -Add Reference to the following EDB assemblies: - -- `EnterpriseDB.EDBClient.EntityFrameworkCore.PostgreSQL.dll` - -- `EnterpriseDB.EDBClient.dll` - -Add the following NuGet packages: - -- `Microsoft.EntityFrameworkCore.Design` - -- `Microsoft.EntityFrameworkCore.Relational` - -- `Microsoft.EntityFrameworkCore.Abstractions` - -**Database-first scenario** - -Issue the following command to create model classes corresponding to all objects in the specified database: - -```text -dotnet ef dbcontext scaffold Host=;Database=;Username=;Password=;Port= EnterpriseDB.EDBClient.EntityFrameworkCore.PostgreSQL -o Models -``` - -**Code-first scenario** - -Add code for defining a DbContext and create, read, update, and delete operations. - -For further details, see the Microsoft documentation. - -Issue the following commands to create the initial database and tables: - -```text - dotnet ef migrations add InitialCreate --context BloggingContext - - dotnet ef database update --context BloggingContext -``` diff --git a/product_docs/docs/net_connector/7.0.6.2/05_using_the_net_connector.mdx b/product_docs/docs/net_connector/7.0.6.2/05_using_the_net_connector.mdx deleted file mode 100644 index dcdac30a376..00000000000 --- a/product_docs/docs/net_connector/7.0.6.2/05_using_the_net_connector.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -title: "Using the .NET Connector" - ---- - - - -These examples show how you can use the EDB object classes that are provided by the EDB .NET Connector that allow a .NET application to connect to and interact with an EDB Postgres Advanced Server database. - -To use these examples, place the .NET library files in the same directory as the compiled form of your application. All of these examples are written in C#, and each is embedded in an ASP.NET page. The same logic and code applies to other .NET applications (WinForm or console applications, for example). - -Create and save the following `web.config` file in the same directory as the sample code. The examples make use of the `DB_CONN_STRING` key from this configuration file to return a connection string from the EDB Postgres Advanced Server host. - -```text - - - - - - -``` - -An EDB Postgres Advanced Server connection string for an ASP.NET web application is stored in the `web.config` file. If you're writing an application that doesn't use ASP.NET, provide the connection information in an application configuration file such as `app.config`. diff --git a/product_docs/docs/net_connector/7.0.6.2/06_opening_a_database_connection.mdx b/product_docs/docs/net_connector/7.0.6.2/06_opening_a_database_connection.mdx deleted file mode 100644 index 8f5eb142b23..00000000000 --- a/product_docs/docs/net_connector/7.0.6.2/06_opening_a_database_connection.mdx +++ /dev/null @@ -1,278 +0,0 @@ ---- -title: "Opening a database connection" - ---- - - - -An `EDBConnection` object is responsible for handling the communication between an instance of EDB Postgres Advanced Server and a .NET application. Before you can access data stored in an EDB Postgres Advanced Server database, you must create and open an `EDBConnection` object. - -## Creating an EDBConnection object - -You can open a connection using one of the following approaches. In either case, you must import the namespace `EnterpriseDB.EDBClient`. - -### Connection with a data source - -1. Create an instance of the `EDBDataSource` object using a connection string as a parameter to the create method of the `EDBDataSource` class. - -2. Call the `OpenConnection` method of the `EDBDataSource` object to open a connection. - -This example shows how to open a connection using a data source: - - ```text - await using var dataSource = EDBDataSource.Create(ConnectionString); - var connection = dataSource.OpenConnection(); - ``` - -### Connection without a data source - -1. Create an instance of the `EDBConnection` object using a connection string as a parameter to the constructor of the `EDBConnection` class. - -2. Call the `Open` method of the `EDBConnection` object to open the connection. - -This example shows how to open a connection without a data source: - - ```text - EDBConnection conn = new EDBConnection(ConnectionString); - conn.Open(); - ``` - -!!! Note - For `EnterpriseDB.EDBClient 7.0.4` and later, we recommend `EDBDataSource` to connect to EDB Postgres Advanced Server database or execute SQL directly against it. For more information on data source, see the [Npgsql documentation](https://www.npgsql.org/doc/basic-usage.html). - - - - -## Connection string parameters - -A valid connection string specifies location and authentication information for an EDB Postgres Advanced Server instance. You must provide the connection string before opening the connection. A connection string must contain: - -- The name or IP address of the server -- The name of the EDB Postgres Advanced Server database -- The name of an EDB Postgres Advanced Server user -- The password associated with that user - -You can include the following parameters in the connection string: - -`CommandTimeout` - - `CommandTimeout` specifies the length of time (in seconds) to wait for a command to finish executing before throwing an exception. The default value is `20`. - -`ConnectionLifeTime` - - Use `ConnectionLifeTime` to specify the length of time (in seconds) to wait before closing unused connections in the pool. The default value is `15`. - -`Database` - - Use the `Database` parameter to specify the name of the database for the application to connect to. The default is the name of the connecting user. - -`Encoding` - - The `Encoding` parameter is obsolete. The parameter always returns the string `unicode` and silently ignores attempts to set it. - -`Integrated Security` - - Specify a value of `true` to use Windows Integrated Security. By default, `Integrated Security` is set to `false`, and Windows Integrated Security is disabled. - -`Load Role Based Tables` - - Use `Load Role Based Tables` to load table OIDs based on role. This change affects only the loading of table type OID and not the composite type. Setting this parameter to `true` triggers the new functionality. The default value is `false`. - -`MaxPoolSize` - - `MaxPoolSize` instructs `EDBConnection` to dispose of pooled connections when the pool exceeds the specified number of connections. The default value is `20`. - -`MinPoolSize` - - `MinPoolSize` instructs `EDBConnection` to preallocate the specified number of connections with the server. The default value is `1`. - -`Password` - - When using clear text authentication, specify the password to use to establish a connection with the server. - -`Pooling` - - Specify a value of `false` to disable connection pooling. By default, `Pooling` is set to `true` to enable connection pooling. - -`No Reset On Close` - -When `Pooling` is enabled and the connection is closed, reopened, and the underlying connection is reused, then some operations are executed to discard the previous connection resources. You can override this behavior by enabling `No Reset On Close`. - -`Port` - - The `Port` parameter specifies the port for the application to connect to. - -`Protocol` - - The specific protocol version to use (instead of automatic). Specify an integer value of `2` or `3`. - -`SearchPath` - - Use the `SearchPath` parameter to change the search path to named and public schemas. - -`Server` - - The name or IP address of the EDB Postgres Advanced Server host. - -`SSL` - - Specify a value of `true` to attempt a secure connection. By default, `SSL` is set to `false`. - -`sslmode` - - Use `sslmode` to specify an SSL connection control preference. `sslmode` can be: - -- `prefer` — Use SSL if possible. - -- `require` — Throw an exception if an SSL connection can't be established. - -- `allow` — Connect without SSL. This parameter isn't supported. - -- `disable` — Don't attempt an SSL connection. This is the default behavior. - -`SyncNotification` - - Use the `SyncNotification` parameter to specify for `EDBDataprovider` to use synchronous notifications. The default value is `false`. - -`Timeout` - - `Timeout` specifies the length of time (in seconds) to wait for an open connection. The default value is `15`. - -`User Id` - - The `User Id` parameter specifies the user name to use for the connection. - -## Example: Opening a database connection using ASP.NET - -This example shows how to open a connection to an instance of EDB Postgres Advanced Server and then close the connection. The connection is established using the credentials specified in the `DB_CONN_STRING` configuration parameter. See [Using the .Net Connector](05_using_the_net_connector/#using_the_net_connector) for an introduction to connection information. Also see [Connection string parameters](#connection-string-parameters) for connection parameters. - -```cpp -<% @ Page Language="C#" %> -<% @Import Namespace="EnterpriseDB.EDBClient" %> -<% @Import Namespace="System.Configuration" %> - -``` - -If the connection is successful, a message appears indicating that the connection opened successfully. - -## Example: Opening a database connection from a console application - -This example opens a connection with an EDB Postgres Advanced Server database using a console-based application. - -Before writing the code for the console application, create an `app.config` file that stores the connection string to the database. Using a configuration file makes it convenient to update the connection string if the information changes. - -```ini - - - - - - -``` - -Enter the following code sample into a file: - -```csharp -using System; -using System.Data; -using EnterpriseDB.EDBClient; -using System.Configuration; -namespace EnterpriseDB -{ - class EDB - { - static void Main(string[] args) - { - var strConnectionString = ConfigurationManager.AppSettings["DB_CONN_STRING"]; - try - { - await using var dataSource = EDBDataSource.Create(strConnectionString); - var conn = dataSource.OpenConnection(); - Console.WriteLine("Connection Opened Successfully"); - conn.Close(); - } - catch(Exception exp) - { - throw new Exception(exp.ToString()); - } - } - } -} -``` - -Save the file as `EDBConnection-Sample.cs` and compile it with the following command: - -```text -csc /r:EnterpriseDB.EDBClient.dll /out:Console.exe EDBConnection-Sample.cs` -``` - -Compiling the sample generates a `Console.exe` file. You can execute the sample code by entering `Console.exe`. When executed, the console verifies that it opened successfully. - -## Example: Opening a database connection from a Windows form application - -This example opens a database connection using a .NET WinForm application. To use the example, save the following code as `WinForm-Example.cs` in a directory that contains the library files. - -```csharp -using System; -using System.Windows.Forms; -using System.Drawing; -using EnterpriseDB.EDBClient; -namespace EDBTestClient -{ - class Win_Conn - { - static void Main(string[] args) - { - Form frmMain = new Form(); - Button btnConn = new Button(); - btnConn.Location = new System.Drawing.Point(104, 64); - btnConn.Name = "btnConn"; - btnConn.Text = "Open Connection"; - btnConn.Click += new System.EventHandler(btnConn_Click); - frmMain.Controls.Add(btnConn); - frmMain.Text = "EnterpriseDB"; - Application.Run(frmMain); - } - private static void btnConn_Click(object sender, System.EventArgs e) - { - try - { - var strConnectionString = "Server=localhost;port=5444;username=edb;password=edb;database=edb"; - await using var dataSource = EDBDataSource.Create(strConnectionString); - var conn = dataSource.OpenConnection(); - MessageBox.Show("Connection Opened Successfully"); - conn.Close(); - } - catch(EDBException exp) - { - MessageBox.Show(exp.ToString()); - } - } - } -} -``` - -Change the database connection string to point to the database that you want to connect to. Then compile the file with the following command: - -```text -csc /r:EnterpriseDB.EDBClient.dll /out:WinForm.exe WinForm-Example.cs -``` - -This command generates a `WinForm.exe` file in the same folder that the executable was compiled under. Invoking the executable displays a message that the connection was successful. diff --git a/product_docs/docs/net_connector/7.0.6.2/07_retrieving_database_records.mdx b/product_docs/docs/net_connector/7.0.6.2/07_retrieving_database_records.mdx deleted file mode 100644 index c8c7cc6fb3a..00000000000 --- a/product_docs/docs/net_connector/7.0.6.2/07_retrieving_database_records.mdx +++ /dev/null @@ -1,102 +0,0 @@ ---- -title: "Retrieving database records" - ---- - - - -You can use a `SELECT` statement to retrieve records from the database using a `SELECT` command. To execute a `SELECT` statement you must: - -- Create and open a database connection. -- Create an `EDBCommand` object that represents the `SELECT` statement. -- Execute the command with the `ExecuteReader()` method of the `EDBCommand` object returning `EDBDataReader`. -- Loop through the `EDBDataReader`, displaying the results or binding the `EDBDataReader` to some control. - -An `EDBDataReader` object represents a forward-only and read-only stream of database records, presented one record at a time. To view a subsequent record in the stream, you must call the `Read()` method of the `EDBDataReader` object. - -The example that follows: - -1. Imports the EDB Postgres Advanced Server namespace `EnterpriseDB.EDBClient`. -2. Initializes an `EDBCommand` object with a `SELECT` statement. -3. Opens a connection to the database. -4. Executes the `EDBCommand` by calling the `ExecuteReader` method of the `EDBCommand` object. - -The results of the SQL statement are retrieved into an `EDBDataReader` object. - -Loop through the contents of the `EDBDataReader` object to display the records returned by the query in a `WHILE` loop. - -The `Read()` method advances to the next record (if there is one) and returns `true` if a record exists. It returns `false` if `EDBDataReader` has reached the end of the result set. - -```cpp -<% @ Page Language="C#" %> -<% @Import Namespace="EnterpriseDB.EDBClient" %> -<% @Import Namespace="System.Data" %> -<% @Import Namespace="System.Configuration" %> - - -``` - -To exercise the sample code, save the code in your default web root directory in a file named `selectEmployees.aspx`. Then, to invoke the program, enter the following URL in a browser: `http://localhost/selectEmployees.aspx`. - -## Retrieving a single database record - -To retrieve a single result from a query, use the `ExecuteScalar()` method of the `EDBCommand` object. The `ExecuteScalar()` method returns the first value of the first column of the first row of the `DataSet` generated by the specified query. - -```cpp -<% @ Page Language="C#" %> -<% @Import Namespace="EnterpriseDB.EDBClient" %> -<% @Import Namespace="System.Data" %> -<% @Import Namespace="System.Configuration" %> - -``` - -Save the sample code in a file named `selectscalar.aspx` in a web root directory. - -To invoke the sample code, enter the following in a browser: `http://localhost/selectScalar.aspx` - -The sample includes an explicit conversion of the value returned by the `ExecuteScalar()` method. The `ExecuteScalar()` method returns an object. To view the object, you must convert it to an integer value by using the `Convert.ToInt32` method. diff --git a/product_docs/docs/net_connector/7.0.6.2/08_parameterized_queries.mdx b/product_docs/docs/net_connector/7.0.6.2/08_parameterized_queries.mdx deleted file mode 100644 index c6e393c296f..00000000000 --- a/product_docs/docs/net_connector/7.0.6.2/08_parameterized_queries.mdx +++ /dev/null @@ -1,47 +0,0 @@ ---- -title: "Parameterized queries" - ---- - - - -A _parameterized query_ is a query with one or more parameter markers embedded in the SQL statement. Before executing a parameterized query, you must supply a value for each marker found in the text of the SQL statement. - -Parameterized queries are useful when you don't know the complete text of a query when you write your code. For example, the value referenced in a `WHERE` clause can be calculated from user input. - -As shown in the following example, you must declare the data type of each parameter specified in the parameterized query by creating an `EDBParameter` object and adding that object to the command's parameter collection. Then, you must specify a value for each parameter by calling the parameter's `Value()` function. - -The example shows using a parameterized query with an `UPDATE` statement that increases an employee salary: - -```cpp -<% @ Page Language="C#" Debug="true"%> -<% @Import Namespace="EnterpriseDB.EDBClient" %> -<% @Import Namespace="System.Data" %> -<% @Import Namespace="System.Configuration" %> - -``` - -Save the sample code in a file named `updateSalary.aspx` in a web root directory. - -To invoke the sample code, enter the following in a browser: `http://localhost/updateSalary.aspx` diff --git a/product_docs/docs/net_connector/7.0.6.2/09_inserting_records_in_a_database.mdx b/product_docs/docs/net_connector/7.0.6.2/09_inserting_records_in_a_database.mdx deleted file mode 100644 index 228224eb3b8..00000000000 --- a/product_docs/docs/net_connector/7.0.6.2/09_inserting_records_in_a_database.mdx +++ /dev/null @@ -1,47 +0,0 @@ ---- -title: "Inserting records in a database" - ---- - - - -You can use the `ExecuteNonQuery()` method of `EDBCommand` to add records to a database stored on an EDB Postgres Advanced Server host with an `INSERT` command. - -In the example that follows, the `INSERT` command is stored in the variable `cmd`. The values prefixed with a colon (`:`) are placeholders for `EDBParameters` that are instantiated, assigned values, and then added to the `INSERT` command's parameter collection in the statements that follow. The `INSERT` command is executed by the `ExecuteNonQuery()` method of the `cmdInsert` object. - -The example adds an employee to the `emp` table: - -```cpp -<% @ Page Language="C#" Debug="true"%> -<% @Import Namespace="EnterpriseDB.EDBClient" %> -<% @Import Namespace="System.Data" %> -<% @Import Namespace="System.Configuration" %> - -``` - -Save the sample code in a file named `insertEmployee.aspx` in a web root directory. - -To invoke the sample code, enter the following in a browser: `http://localhost/insertEmployee.aspx` diff --git a/product_docs/docs/net_connector/7.0.6.2/10_deleting_records_in_a_database.mdx b/product_docs/docs/net_connector/7.0.6.2/10_deleting_records_in_a_database.mdx deleted file mode 100644 index 8c797af0868..00000000000 --- a/product_docs/docs/net_connector/7.0.6.2/10_deleting_records_in_a_database.mdx +++ /dev/null @@ -1,44 +0,0 @@ ---- -title: "Deleting records in a database" - ---- - - - -You can use the `ExecuteNonQuery()` method of `EDBCommand` to delete records from a database stored on an EDB Postgres Advanced Server host with a `DELETE` statement. - -In the example that follows, the `DELETE` command is stored in the variable `strDeleteQuery`. The code passes the employee number specified by `EmpNo` to the `DELETE` command. The command is then executed using the `ExecuteNonQuery()` method. - -```cpp -<% @ Page Language="C#" Debug="true"%> -<% @Import Namespace="EnterpriseDB.EDBClient" %> -<% @Import Namespace="System.Data" %> -<% @Import Namespace="System.Configuration" %> - -``` - -Save the sample code in a file named `deleteEmployee.aspx` in a web root directory. - -To invoke the sample code, enter the following in a browser: `http://localhost/deleteEmployee.aspx` diff --git a/product_docs/docs/net_connector/7.0.6.2/11_using_spl_stored_procedures_in_your_net_application.mdx b/product_docs/docs/net_connector/7.0.6.2/11_using_spl_stored_procedures_in_your_net_application.mdx deleted file mode 100644 index 51a2c02f6f6..00000000000 --- a/product_docs/docs/net_connector/7.0.6.2/11_using_spl_stored_procedures_in_your_net_application.mdx +++ /dev/null @@ -1,340 +0,0 @@ ---- -title: "Using SPL stored procedures in your .NET application" - ---- - - - -You can include SQL statements in an application in two ways: - -- By adding the SQL statements directly in the .NET application code -- By packaging the SQL statements in a stored procedure and executing the stored procedure from the .NET application - -In some cases, a stored procedure can provide advantages over embedded SQL statements. Stored procedures support complex conditional and looping constructs that are difficult to duplicate with SQL statements embedded directly in an application. - -You can also see an improvement in performance by using stored procedures. A stored procedure needs to be parsed, compiled, and optimized only once on the server side. A SQL statement that's included in an application might be parsed, compiled, and optimized each time it's executed from a .NET application. - -To use a stored procedure in your .NET application you must: - -1. Create an SPL stored procedure on the EDB Postgres Advanced Server host. -2. Import the `EnterpriseDB.EDBClient` namespace. -3. Pass the name of the stored procedure to the instance of the `EDBCommand`. -4. Change the `EDBCommand.CommandType` to `CommandType.StoredProcedure`. -5. `Prepare()` the command. -6. Execute the command. - -## Example: Executing a stored procedure without parameters - -This sample procedure prints the name of department 10. The procedure takes no parameters and returns no parameters. To create the sample procedure, invoke EDB-PSQL and connect to the EDB Postgres Advanced Server host database. Enter the following SPL code at the command line: - -```sql -CREATE OR REPLACE PROCEDURE list_dept10 -IS - v_deptname VARCHAR2(30); -BEGIN - DBMS_OUTPUT.PUT_LINE('Dept No: 10'); - SELECT dname INTO v_deptname FROM dept WHERE deptno = 10; - DBMS_OUTPUT.PUT_LINE('Dept Name: ' || v_deptname); -END; -``` - -When EDB Postgres Advanced Server validates the stored procedure, it echoes `CREATE PROCEDURE`. - -### Using the EDBCommand object to execute a stored procedure - -The `CommandType` property of the `EDBCommand` object indicates the type of command being executed. The `CommandType` property is set to one of three possible `CommandType` enumeration values: - -- Use the default `Text` value when passing a SQL string for execution. -- Use the `StoredProcedure` value, passing the name of a stored procedure for execution. -- Use the `TableDirect` value when passing a table name. This value passes back all records in the specified table. - -The `CommandText` property must contain a SQL string, stored procedure name, or table name, depending on the value of the `CommandType` property. - -The following example executes the stored procedure: - -```cpp -<% @ Page Language="C#" Debug="true"%> -<% @Import Namespace="EnterpriseDB.EDBClient" %> -<% @Import Namespace="System.Data" %> -<% @Import Namespace="System.Configuration" %> - -``` - -Save the sample code in a file named `storedProc.aspx` in a web root directory. - -To invoke the sample code, enter the following in a browser: `http://localhost/storedProc.aspx` - -## Example: Executing a stored procedure with IN parameters - -This example calls a stored procedure that includes `IN` parameters. To create the sample procedure, invoke EDB-PSQL and connect to the EDB Postgres Advanced Server host database. Enter the following SPL code at the command line: - -```sql -CREATE OR REPLACE PROCEDURE - EMP_INSERT - ( - pENAME IN VARCHAR, - pJOB IN VARCHAR, - pSAL IN FLOAT4, - pCOMM IN FLOAT4, - pDEPTNO IN INTEGER, - pMgr IN INTEGER - ) -AS -DECLARE - CURSOR TESTCUR IS SELECT MAX(EMPNO) FROM EMP; - MAX_EMPNO INTEGER := 10; -BEGIN - - OPEN TESTCUR; - FETCH TESTCUR INTO MAX_EMPNO; - INSERT INTO EMP(EMPNO,ENAME,JOB,SAL,COMM,DEPTNO,MGR) - VALUES(MAX_EMPNO+1,pENAME,pJOB,pSAL,pCOMM,pDEPTNO,pMgr); - CLOSE testcur; -END; - -``` - -When EDB Postgres Advanced Server validates the stored procedure, it echoes `CREATE PROCEDURE`. - -### Passing input values to a stored procedure - -Calling a stored procedure that contains parameters is similar to executing a stored procedure without parameters. The major difference is that, when calling a parameterized stored procedure, you must use the `EDBParameter` collection of the `EDBCommand` object. When the `EDBParameter` is added to the `EDBCommand` collection, properties such as `ParameterName`, `DbType`, `Direction`, `Size`, and `Value` are set. - -This example shows the process of executing a parameterized stored procedure from a C# script: - -```cpp -<% @ Page Language="C#" Debug="true"%> -<% @Import Namespace="EnterpriseDB.EDBClient" %> -<% @Import Namespace="System.Data" %> -<% @Import Namespace="System.Configuration" %> - -``` - -Save the sample code in a file named `storedProcInParam.aspx` in a web root directory. - -To invoke the sample code, enter the following in a browser: `http://localhost/storedProcInParam.aspx` - -In the example, the body of the `Page_Load` method declares and instantiates an `EDBConnection` object. The sample then creates an `EDBCommand` object with the properties needed to execute the stored procedure. - -The example then uses the `Add` method of the `EDBCommand Parameter` collection to add six input parameters. - -```cpp -EDBCommand cmdStoredProc = new EDBCommand -("emp_insert(:EmpName,:Job,:Salary,:Commission,:DeptNo,:Manager)",conn); -cmdStoredProc.CommandType = CommandType.StoredProcedure; -``` - -It assigns a value to each parameter before passing them to the `EMP_INSERT` stored procedure. - -The `Prepare()` method prepares the statement before calling the `ExecuteNonQuery()` method. - -The `ExecuteNonQuery` method of the `EDBCommand` object executes the stored procedure. After the stored procedure executes, a test record is inserted into the `emp` table, and the values inserted are displayed on the web page. - -## Example: Executing a stored procedure with IN, OUT, and INOUT parameters - -The previous example showed how to pass `IN` parameters to a stored procedure. The following examples show how to pass `IN` values and return `OUT` values from a stored procedure. - -### Creating the stored procedure - -The following stored procedure passes the department number and returns the corresponding location and department name. To create the sample procedure, invoke EDB-PSQL and connect to the EDB Postgres Advanced Server host database. Enter the following SPL code at the command line: - -```sql -CREATE OR REPLACE PROCEDURE - DEPT_SELECT - ( - pDEPTNO IN INTEGER, - pDNAME OUT VARCHAR, - pLOC OUT VARCHAR - ) -AS -DECLARE - CURSOR TESTCUR IS SELECT DNAME,LOC FROM DEPT; - REC RECORD; -BEGIN - - OPEN TESTCUR; - FETCH TESTCUR INTO REC; - - pDNAME := REC.DNAME; - pLOC := REC.LOC; - - CLOSE testcur; -END; -``` - -When EDB Postgres Advanced Server validates the stored procedure, it echoes `CREATE PROCEDURE`. - -### Receiving output values from a stored procedure - -When retrieving values from `OUT` parameters, you must explicitly specify the direction of those parameters as `Output`. You can retrieve the values from `Output` parameters in two ways: - -- Call the `ExecuteReader` method of the `EDBCommand` and explicitly loop through the returned `EDBDataReader`, searching for the values of `OUT` parameters. -- Call the `ExecuteNonQuery` method of `EDBCommand` and explicitly get the value of a declared `Output` parameter by calling that `EDBParameter` value property. - -In each method, you must declare each parameter, indicating the direction of the parameter (`ParameterDirection.Input`, `ParameterDirection.Output`, or `ParameterDirection.InputOutput`). Before invoking the procedure, you must provide a value for each `IN` and `INOUT` parameter. After the procedure returns, you can retrieve the `OUT` and `INOUT` parameter values from the `command.Parameters[]` array. - -This code shows using the `ExecuteReader` method to retrieve a result set: - -```cpp -<% @ Page Language="C#" Debug="true"%> -<% @Import Namespace="EnterpriseDB.EDBClient" %> -<% @Import Namespace="System.Data" %> -<% @Import Namespace="System.Configuration" %> - -``` - -This code shows using the `ExecuteNonQuery` method to retrieve a result set: - -```cpp -<% @ Page Language="C#" Debug="true"%> -<% @Import Namespace="EnterpriseDB.EDBClient" %> -<% @Import Namespace="System.Data" %> -<% @Import Namespace="System.Configuration" %> - -``` diff --git a/product_docs/docs/net_connector/7.0.6.2/12_using_advanced_queueing.mdx b/product_docs/docs/net_connector/7.0.6.2/12_using_advanced_queueing.mdx deleted file mode 100644 index d50395d0e8f..00000000000 --- a/product_docs/docs/net_connector/7.0.6.2/12_using_advanced_queueing.mdx +++ /dev/null @@ -1,492 +0,0 @@ ---- -title: "Using advanced queueing" - ---- - - - -EDB Postgres Advanced Server advanced queueing provides message queueing and message processing for the EDB Postgres Advanced Server database. User-defined messages are stored in a queue. A collection of queues is stored in a queue table. Create a queue table before creating a queue that depends on it. - -On the server side, procedures in the `DBMS_AQADM` package create and manage message queues and queue tables. Use the `DBMS_AQ` package to add messages to or remove messages from a queue or register or unregister a PL/SQL callback procedure. For more information about `DBMS_AQ` and `DBMS_AQADM`, see [DBMS_AQ](/epas/latest/reference/oracle_compatibility_reference/epas_compat_bip_guide/03_built-in_packages/02_dbms_aq/). - -On the client side, the application uses the EDB.NET driver to enqueue and dequeue messages. - -## Enqueueing or dequeueing a message - -For more information about using EDB Postgres Advanced Server's advanced queueing functionality, see [Built-in packages](/epas/latest/reference/oracle_compatibility_reference/epas_compat_bip_guide/). - -### Server-side setup - -To use advanced queueing functionality on your .NET application, you must first create a user-defined type, queue table, and queue, and then start the queue on the database server. Invoke EDB-PSQL and connect to the EDB Postgres Advanced Server host database. Use the following SPL commands at the command line: - -#### Creating a user-defined type - -To specify a RAW data type, create a user-defined type. This example shows creating a user-defined type named as `myxml`: - -``` -CREATE TYPE myxml AS (value XML); -``` - -#### Creating the queue table - -A queue table can hold multiple queues with the same payload type. This example shows creating a table named `MSG_QUEUE_TABLE`: - -```Text -EXEC DBMS_AQADM.CREATE_QUEUE_TABLE - (queue_table => 'MSG_QUEUE_TABLE', - queue_payload_type => 'myxml', - comment => 'Message queue table'); -END; -``` - -#### Creating the queue - -This example shows creating a queue named `MSG_QUEUE` in the table `MSG_QUEUE_TABLE`: - -```Text -BEGIN -DBMS_AQADM.CREATE_QUEUE ( queue_name => 'MSG_QUEUE', queue_table => 'MSG_QUEUE_TABLE', comment => 'This queue contains pending messages.'); -END; -``` - -**Starting the queue** - -Once the queue is created, invoke the following SPL code at the command line to start a queue in the EDB database: - -```Text -BEGIN -DBMS_AQADM.START_QUEUE -(queue_name => 'MSG_QUEUE'); -END; -``` - -### Client-side example - -Once you've created a user-defined type, followed by queue table and queue, start the queue. Then, you can enqueue or dequeue a message using EDB .Net drivers. - -#### Enqueue a message - -To enqueue a message on your .NET application, you must: - -1. Import the `EnterpriseDB.EDBClient` namespace. -2. Pass the name of the queue and create the instance of the `EDBAQQueue`. -3. Create the enqueue message and define a payload. -4. Call the `queue.Enqueue` method. - -The following code shows using the `queue.Enqueue` method. - -!!! Note - This code creates the message and serializes it. This is example code and doesn't compile if copied as it is. You must serialize the message as XML. - -```Text -using EnterpriseDB.EDBClient; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace AQXml -{ - class MyXML - { - public string value { get; set; } - } - class Program - { - static void Main(string[] args) - { - int messagesToSend = 1; - if (args.Length > 0 && !string.IsNullOrEmpty(args[0])) - { - messagesToSend = int.Parse(args[0]); - } - for (int i = 0; i < 5; i++) - { - EnqueMsg("test message: " + i); - } - } - - private static EDBConnection GetConnection() - { - string connectionString = "Server=127.0.0.1;Host=127.0.0.1;Port=5444;User Id=enterprisedb;Password=test;Database=edb;Timeout=999"; - EDBConnection connection = new EDBConnection(connectionString); - connection.Open(); - return connection; - } - - - private static string ByteArrayToString(byte[] byteArray) - { - // Sanity check if it's null so we don't incur overhead of an exception - if (byteArray == null) - { - return string.Empty; - } - try - { - StringBuilder hex = new StringBuilder(byteArray.Length * 2); - foreach (byte b in byteArray) - { - hex.AppendFormat("{0:x2}", b); - } - - return hex.ToString().ToUpper(); - } - catch - { - return string.Empty; - } - } - - private static bool EnqueMsg(string msg) - { - EDBConnection con = GetConnection(); - using (EDBAQQueue queue = new EDBAQQueue("MSG_QUEUE", con)) - { - queue.MessageType = EDBAQMessageType.Xml; - EDBTransaction txn = queue.Connection.BeginTransaction(); - QueuedEntities.Message queuedMessage = new QueuedEntities.Message() { MessageText = msg }; - - try - { - string rootElementName = queuedMessage.GetType().Name; - if (rootElementName.IndexOf(".") != -1) - { - rootElementName = rootElementName.Split('.').Last(); - } - - string xml = new Utils.XmlFragmentSerializer().Serialize(queuedMessage); - EDBAQMessage queMsg = new EDBAQMessage(); - queMsg.Payload = new MyXML { value = xml }; - queue.MessageType = EDBAQMessageType.Udt; - queue.UdtTypeName = "myxml"; - EDBConnection.GlobalTypeMapper.MapComposite("myxml"); - con.ReloadTypes(); - queue.Enqueue(queMsg); - var messageId = ByteArrayToString((byte[])queMsg.MessageId); - Console.WriteLine("MessageID: " + messageId); - txn.Commit(); - queMsg = null; - xml = null; - rootElementName = null; - return true; - } - catch (Exception ex) - { - txn?.Rollback(); - Console.WriteLine("Failed to enqueue message."); - Console.WriteLine(ex.ToString()); - return false; - } - finally - { - queue?.Connection?.Dispose(); - } - } - } - - } -} -``` - -#### Dequeueing a message - -To dequeue a message on your .NET application, you must: - -1. Import the `EnterpriseDB.EDBClient` namespace. -2. Pass the name of the queue and create the instance of the `EDBAQQueue`. -3. Call the `queue.Dequeue` method. - -!!! Note - The following code creates the message and serializes it. This is example code and doesn't compile if copied as it is. You must serialize the message as XML. - -```Text -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using EnterpriseDB.EDBClient; - -namespace DequeueXML -{ - class MyXML - { - public string value { get; set; } - } - class Program - { - static void Main(string[] args) - { - DequeMsg(); - } - - - private static EDBConnection GetConnection() - { - string connectionString = "Server=127.0.0.1;Host=127.0.0.1;Port=5444;User Id=enterprisedb;Password=test;Database=edb;Timeout=999"; - EDBConnection connection = new EDBConnection(connectionString); - connection.Open(); - return connection; - } - - - private static string ByteArrayToString(byte[] byteArray) - { - // Sanity check if it's null so we don't incur overhead of an exception - if (byteArray == null) - { - return string.Empty; - } - try - { - StringBuilder hex = new StringBuilder(byteArray.Length * 2); - foreach (byte b in byteArray) - { - hex.AppendFormat("{0:x2}", b); - } - - return hex.ToString().ToUpper(); - } - catch - { - return string.Empty; - } - } - public static void DequeMsg(int waitTime = 10) - { - EDBConnection con = GetConnection(); - using (EDBAQQueue queueListen = new EDBAQQueue("MSG_QUEUE", con)) - { - queueListen.UdtTypeName = "myxml"; - queueListen.DequeueOptions.Navigation = EDBAQNavigationMode.FIRST_MESSAGE; - queueListen.DequeueOptions.Visibility = EDBAQVisibility.ON_COMMIT; - queueListen.DequeueOptions.Wait = 1; - EDBTransaction txn = null; - - while (1 == 1) - { - - if (queueListen.Connection.State == System.Data.ConnectionState.Closed) - { - queueListen.Connection.Open(); - } - - string messageId = "Unknown"; - try - { - // the listen function is a blocking function. It will Wait the specified waitTime or until a - // message is received. - Console.WriteLine("Listening..."); - string v = queueListen.Listen(null, waitTime); - // If we are waiting for a message and we specify a Wait time, - // then if there are no more messages, we want to just bounce out. - if (waitTime > -1 && v == null) - { - Console.WriteLine("No message received during Wait period."); - Console.WriteLine(); - continue; - } - - // once we're here that means a message has been detected in the queue. Let's deal with it. - txn = queueListen.Connection.BeginTransaction(); - - Console.WriteLine("Attempting to dequeue message..."); - // dequeue the message - EDBAQMessage deqMsg; - try - { - deqMsg = queueListen.Dequeue(); - } - catch (Exception ex) - { - if (ex.Message.Contains("ORA-25228")) - { - Console.WriteLine("Message was not there. Another process must have picked it up."); - Console.WriteLine(); - txn.Rollback(); - continue; - } - else - { - throw; - } - } - - messageId = ByteArrayToString((byte[])deqMsg.MessageId); - if (deqMsg != null) - { - Console.WriteLine("Processing received message..."); - // process the message payload - MyXML obj = (MyXML) deqMsg.Payload; - - QueuedEntities.Message msg = new Utils.XmlFragmentSerializer().Deserialize(obj.value); - - Console.WriteLine("Received Message:"); - Console.WriteLine("MessageID: " + messageId); - Console.WriteLine("Message: " + msg.MessageText); - Console.WriteLine("Enqueue Time" + queueListen.MessageProperties.EnqueueTime); - - txn.Commit(); - - Console.WriteLine("Finished processing message"); - Console.WriteLine(); - - } - else - { - Console.WriteLine("Message was not dequeued."); - } - } - catch (Exception ex) - { - Console.WriteLine("Failed To dequeue or process the dequeued message."); - Console.WriteLine(ex.ToString()); - Console.WriteLine(); - if (txn != null) - { - txn.Rollback(); - if (txn != null) - { - txn.Dispose(); - } - } - } - } - } - - } - } -} -``` - -## EDBAQ classes - -The following EDBAQ classes are used in this application. - -### EDBAQDequeueMode - -The `EDBAQDequeueMode` class lists all the dequeuer modes available. - -| Value | Description | -| ------------- | ------------------------------------------------------------- | -| Browse | Reads the message without locking. | -| Locked | Reads and gets a write lock on the message. | -| Remove | Deletes the message after reading. This is the default value. | -| Remove_NoData | Confirms receipt of the message. | - -### EDBAQDequeueOptions - -The `EDBAQDequeueOptions` class lists the options available when dequeuing a message. - -| Property | Description | -| -------------- | ------------------------------------------------------------------------------------------------------------------------------ | -| ConsumerName | The name of the consumer for which to dequeue the message. | -| DequeueMode | Set from `EDBAQDequeueMode`. It represents the locking behavior linked with the dequeue option. | -| Navigation | Set from `EDBAQNavigationMode`. It represents the position of the message to fetch. | -| Visibility | Set from `EDBAQVisibility`. It represents whether the new message is dequeued as part of the current transaction. | -| Wait | The wait time for a message as per the search criteria. | -| Msgid | The message identifier. | -| Correlation | The correlation identifier. | -| DeqCondition | The dequeuer condition. It's a Boolean expression. | -| Transformation | The transformation to apply before dequeuing the message. | -| DeliveryMode | The delivery mode of the dequeued message. | - -### EDBAQEnqueueOptions - -The `EDBAQEnqueueOptions` class lists the options available when enqueuing a message. - -| Property | Description | -| ----------------- | ------------------------------------------------------------------------------------------------------------------------------ | -| Visibility | Set from `EDBAQVisibility`. It represents whether the new message is enqueued as part of the current transaction. | -| RelativeMsgid | The relative message identifier. | -| SequenceDeviation | The sequence when to dequeue the message. | -| Transformation | The transformation to apply before enqueuing the message. | -| DeliveryMode | The delivery mode of the enqueued message. | - -### EDBAQMessage - -The `EDBAQMessage` class lists a message to enqueue/dequeue. - -| Property | Description | -| ------------ | -------------------------------- | -| Payload | The actual message to queue. | -| MessageId | The ID of the queued message. | - -### EDBAQMessageProperties - -The `EDBAQMessageProperties` lists the message properties available. - -| Property | Description | -| ---------------- | --------------------------------------------------------------------------------------------- | -| Priority | The priority of the message. | -| Delay | The duration after which the message is available for dequeuing, in seconds. | -| Expiration | The duration for which the message is available for dequeuing, in seconds. | -| Correlation | The correlation identifier. | -| Attempts | The number of attempts taken to dequeue the message. | -| RecipientList | The recipients list that overthrows the default queue subscribers. | -| ExceptionQueue | The name of the queue to move the unprocessed messages to. | -| EnqueueTime | The time when the message was enqueued. | -| State | The state of the message while dequeued. | -| OriginalMsgid | The message identifier in the last queue. | -| TransactionGroup | The transaction group for the dequeued messages. | -| DeliveryMode | The delivery mode of the dequeued message. | - -### EDBAQMessageState - -The `EDBAQMessageState` class represents the state of the message during dequeue. - -| Value | Description | -| --------- | --------------------------------------------------------- | -| Expired | The message is moved to the exception queue. | -| Processed | The message is processed and kept. | -| Ready | The message is ready to be processed. | -| Waiting | The message is in waiting state. The delay isn't reached. | - -### EDBAQMessageType - -The `EDBAQMessageType` class represents the types for payload. - -| Value | Description | -| --------- | ------------------------------------------------------------------------------------- | -| Raw | The raw message type.

Note: Currently, this payload type isn't supported. | -| UDT | The user-defined type message. | -| XML | The XML type message.

Note: Currently, this payload type isn't supported. | - -### EDBAQNavigationMode - -The `EDBAQNavigationMode` class represents the different types of navigation modes available. - -| Value | Description | -| ---------------- | ------------------------------------------------------------------ | -| First_Message | Returns the first available message that matches the search terms. | -| Next_Message | Returns the next available message that matches the search items. | -| Next_Transaction | Returns the first message of next transaction group. | - -### EDBAQQueue - -The `EDBAQQueue` class represents a SQL statement to execute `DMBS_AQ` functionality on a PostgreSQL database. - -| Property | Description | -| ----------------- | --------------------------------------------------------------------------------------------- | -| Connection | The connection to use. | -| Name | The name of the queue. | -| MessageType | The message type that's enqueued/dequeued from this queue, for example `EDBAQMessageType.Udt`. | -| UdtTypeName | The user-defined type name of the message type. | -| EnqueueOptions | The enqueue options to use. | -| DequeuOptions | The dequeue options to use. | -| MessageProperties | The message properties to use. | - -### EDBAQVisibility - -The `EDBAQVisibility` class represents the visibility options available. - -| Value | Description | -| --------- | ----------------------------------------------------------- | -| Immediate | The enqueue/dequeue isn't part of the ongoing transaction. | -| On_Commit | The enqueue/dequeue is part of the current transaction. | - -!!! Note - - To review the default options for these parameters, see [DBMS_AQ](../../epas/11/epas_compat_bip_guide/03_built-in_packages/02_dbms_aq/). - - EDB advanced queueing functionality uses user-defined types for calling enqueue/dequeue operations. `Server Compatibility Mode=NoTypeLoading` can't be used with advanced queueing because `NoTypeLoading` doesn't load any user-defined types. diff --git a/product_docs/docs/net_connector/7.0.6.2/13_using_a_ref_cursor_in_a_net_application.mdx b/product_docs/docs/net_connector/7.0.6.2/13_using_a_ref_cursor_in_a_net_application.mdx deleted file mode 100644 index 3b77d3f4ba8..00000000000 --- a/product_docs/docs/net_connector/7.0.6.2/13_using_a_ref_cursor_in_a_net_application.mdx +++ /dev/null @@ -1,104 +0,0 @@ ---- -title: "Using a ref cursor in a .NET application" - ---- - - - -A `ref cursor` is a cursor variable that contains a pointer to a query result set. The result set is determined by executing the `OPEN FOR` statement using the cursor variable. A cursor variable isn't tied to a particular query like a static cursor. You can open the same cursor variable a number of times with the `OPEN FOR` statement containing different queries and each time. A new result set is created for that query and made available by way of the cursor variable. You can declare a cursor variable in two ways: - -- Use the `SYS_REFCURSOR` built-in data type to declare a weakly typed ref cursor. -- Define a strongly typed ref cursor that declares a variable of that type. - -`SYS_REFCURSOR` is a ref cursor type that allows any result set to be associated with it. This is known as a weakly typed ref cursor. The following example is a declaration of a weakly typed ref cursor: - -``` - name SYS_REFCURSOR`; -``` - -Following is an example of a strongly typed ref cursor: - -``` -TYPE IS REF CURSOR RETURN emp%ROWTYPE`; -``` - -## Creating the stored procedure - -This sample code creates a stored procedure called `refcur_inout_callee`. It specifies the data type of the ref cursor being passed as an OUT parameter. To create the sample procedure, invoke EDB-PSQL and connect to the EDB Postgres Advanced Server host database. Enter the following SPL code at the command line: - -```sql -CREATE OR REPLACE PROCEDURE - refcur_inout_callee(v_refcur OUT SYS_REFCURSOR) -IS -BEGIN - OPEN v_refcur FOR SELECT ename FROM emp; -END; -``` - -This C# code uses the stored procedure to retrieve employee names from the `emp` table: - -```cpp -using System; -using System.Data; -using EnterpriseDB.EDBClient; -using System.Configuration; -namespace EDBRefCursor -{ - class EmpRefcursor - { - [STAThread] - static void Main(string[] args) - { - var strConnectionString = - ConfigurationManager.AppSettings["DB_CONN_STRING"]; - try - { - await using var dataSource = EDBDataSource.Create(ConnectionString); - var conn = await dataSource.OpenConnectionAsync(); - await using var tran = await connection.BeginTransactionAsync(); - using var command = new EDBCommand("refcur_inout_callee", conn); - command.CommandType = CommandType.StoredProcedure; - command.Transaction = tran; - command.Parameters.Add(new EDBParameter("refCursor", - EDBTypes.EDBDbType.Refcursor, 10, "refCursor", - ParameterDirection.Output, false, 2, 2, - System.Data.DataRowVersion.Current, null)); - await command.PrepareAsync(); - command.Parameters[0].Value = null; - await command.ExecuteNonQueryAsync(); - var cursorName = command.Parameters[0].Value.ToString(); - command.CommandText = "fetch all in \"" + cursorName + "\""; - command.CommandType = CommandType.Text; - await using var reader = - await command.ExecuteReaderAsync(CommandBehavior.SequentialAccess); - var fc = reader.FieldCount; - while (await reader.ReadAsync()) - { - for (int i = 0; i < fc; i++) - { - Console.WriteLine(reader.GetString(i)); - } - } - await reader.CloseAsync(); - await tran.CommitAsync(); - await conn.CloseAsync(); - } - catch (Exception ex) - { - Console.WriteLine(ex.Message.ToString()); - } - } - } -} -``` - -This .NET code snippet displays the result on the console: - -```cpp -for(int i = 0;i < fc; i++) -{ - Console.WriteLine(reader.GetString(i)); -} -``` - -You must bind the `EDBDbType.RefCursor` type in `EDBParameter()` if you're using a ref cursor parameter. diff --git a/product_docs/docs/net_connector/7.0.6.2/14_using_plugins.mdx b/product_docs/docs/net_connector/7.0.6.2/14_using_plugins.mdx deleted file mode 100644 index 9e8a3b1389e..00000000000 --- a/product_docs/docs/net_connector/7.0.6.2/14_using_plugins.mdx +++ /dev/null @@ -1,72 +0,0 @@ ---- -title: "Using plugins" - ---- - - - -EDB .Net driver plugins support the enhanced capabilities for different data types that are otherwise not available in .Net. The different plugins available support: - -- GeoJSON -- Json.NET -- NetTopologySuite -- NodaTime - -The plugins support the use of spatial, data/time, and JSON types. The following are the supported frameworks and data provider installation path for these plugins. - -## GeoJSON - -If you're using the GeoJSON plugin on .NET Standard 2.0, the data provider installation paths are: - -- `C:\Program Files\edb\dotnet\plugins\GeoJSON\netstandard2.0` -- `C:\Program Files\edb\dotnet\plugins\GeoJSON\net472` -- `C:\Program Files\edb\dotnet\plugins\GeoJSON\net48` -- `C:\Program Files\edb\dotnet\plugins\GeoJSON\net481` - -The following shared library files are required: - -- `EnterpriseDB.EDBClient.GeoJSON.dll` - -For detailed information about using the GeoJSON plugin, see the [Npgsql documentation](http://www.npgsql.org/doc/types/geojson.html). - -## Json.NET - -If you're using the Json.NET plugin on .NET Standard 2.0, the data provider installation paths are: -- `C:\Program Files\edb\dotnet\plugins\Json.NET\netstandard2.0` -- `C:\Program Files\edb\dotnet\plugins\Json.NET\net472` -- `C:\Program Files\edb\dotnet\plugins\Json.NET\net48` -- `C:\Program Files\edb\dotnet\plugins\Json.NET\net481` - -The following shared library files are required: - -- `EnterpriseDB.EDBClient.Json.NET.dll` - -For detailed information about using the Json.NET plugin, see the [Npgsql documentation](http://www.npgsql.org/doc/types/jsonnet.html). - -## NetTopologySuite - -If you're using the NetTopologySuite plugin on .Net Standard 2.0, the data provider installation paths are: -- `C:\Program Files\edb\dotnet\plugins\NetTopologySuite\netstandard2.0` -- `C:\Program Files\edb\dotnet\plugins\NetTopologySuite\net472` -- `C:\Program Files\edb\dotnet\plugins\NetTopologySuite\net48` -- `C:\Program Files\edb\dotnet\plugins\NetTopologySuite\net481` - -The following shared library files are required: - -- `EnterpriseDB.EDBClient.NetTopologySuite.dll` - -For detailed information about using the NetTopologySuite type plugin, see the [Npgsql documentation](http://www.npgsql.org/doc/types/nts.html). - -## NodaTime - -If you're using the NodaTime plugin on .Net Standard 2.0, the data provider installation paths are: -- `C:\Program Files\edb\dotnet\plugins\NodaTime\netstandard2.0` -- `C:\Program Files\edb\dotnet\plugins\NodaTime\net472` -- `C:\Program Files\edb\dotnet\plugins\NodaTime\net48` -- `C:\Program Files\edb\dotnet\plugins\NodaTime\net481` - -The following shared library files are required: - -- `EnterpriseDB.EDBClient.NodaTime.dll` - -For detailed information about using the NodaTime plugin, see the [Npgsql documentation](http://www.npgsql.org/doc/types/nodatime.html). diff --git a/product_docs/docs/net_connector/7.0.6.2/15_using_object_types.mdx b/product_docs/docs/net_connector/7.0.6.2/15_using_object_types.mdx deleted file mode 100644 index c57c5ba4713..00000000000 --- a/product_docs/docs/net_connector/7.0.6.2/15_using_object_types.mdx +++ /dev/null @@ -1,181 +0,0 @@ ---- -title: "Using object types in .NET" - ---- - - - -The SQL `CREATE TYPE` command creates a user-defined object type, which is stored in the EDB Postgres Advanced Server database. You can then reference these user-defined types in SPL procedures, SPL functions, and .NET programs. - -Create the basic object type with the `CREATE TYPE AS OBJECT` command. Optionally, use the `CREATE TYPE BODY` command. - -## Using an object type - -To use an object type, you must first create the object type in the EDB Postgres Advanced Server database. Object type `addr_object_type` defines the attributes of an address: - -```text -CREATE OR REPLACE TYPE addr_object_type AS OBJECT -( - street VARCHAR2(30), - city VARCHAR2(20), - state CHAR(2), - zip NUMBER(5) -); -``` - -Object type `emp_obj_typ` defines the attributes of an employee. One of these attributes is object type `ADDR_OBJECT_TYPE`, as previously described. The object type body contains a method that displays the employee information: - -```text -CREATE OR REPLACE TYPE emp_obj_typ AS OBJECT -( - empno NUMBER(4), - ename VARCHAR2(20), - addr ADDR_OBJECT_TYPE, - MEMBER PROCEDURE display_emp(SELF IN OUT emp_obj_typ) -); - -CREATE OR REPLACE TYPE BODY emp_obj_typ AS - MEMBER PROCEDURE display_emp (SELF IN OUT emp_obj_typ) - IS - BEGIN - DBMS_OUTPUT.PUT_LINE('Employee No : ' || SELF.empno); - DBMS_OUTPUT.PUT_LINE('Name : ' || SELF.ename); - DBMS_OUTPUT.PUT_LINE('Street : ' || SELF.addr.street); - DBMS_OUTPUT.PUT_LINE('City/State/Zip: ' || SELF.addr.city || ', ' || - SELF.addr.state || ' ' || LPAD(SELF.addr.zip,5,'0')); - END; -END; -``` - -This example is a complete .NET program that uses these user-defined object types: - -```text -using EnterpriseDB.EDBClient; -using System.Data.Common; -namespace TypesTest -{ - internal class Program - { - static async Task Main(string[] args) - { - var connString = "Server=localhost;Port=5444;database=edb;User ID=enterprisedb;password=edb;"; - var dataSourceBuilder = new EDBDataSourceBuilder(connString); - dataSourceBuilder.MapComposite("enterprisedb.addr_object_type"); - dataSourceBuilder.MapComposite("enterprisedb.emp_obj_typ"); - await using var dataSource = dataSourceBuilder.Build(); - await using var conn = await dataSource.OpenConnectionAsync(); - try - { - var address = new addr_object_type() - { - street = "123 MAIN STREET", - city = "EDISON", - state = "NJ", - zip = 8817 - }; - var emp = new emp_obj_typ() - { - empno = 9001, - ename = "JONES", - addr = address - }; - await using (var cmd = new EDBCommand("emp_obj_typ.display_emp", conn)) - { - cmd.CommandType = System.Data.CommandType.StoredProcedure; - EDBCommandBuilder.DeriveParameters(cmd); - cmd.Parameters[0].Value = emp; - cmd.Prepare(); - cmd.ExecuteNonQuery(); - var empOut = (emp_obj_typ?)cmd.Parameters[0].Value; - Console.WriteLine("Emp No: " + empOut.empno); - Console.WriteLine("Emp Name: " + empOut.ename); - Console.WriteLine("Emp Address Street: " + empOut.addr.street); - Console.WriteLine("Emp Address City: " + empOut.addr.city); - Console.WriteLine("Emp Address State: " + empOut.addr.state); - Console.WriteLine("Emp Address Zip: " + empOut.addr.zip); - Console.WriteLine("Emp No: " + empOut.empno); - } - } - catch (EDBException exp) - { - Console.WriteLine(exp.Message.ToString()); - } - finally - { - conn.Close(); - } - } - } -public class addr_object_type - { - public string? street; - public string? city; - public string? state; - public decimal zip; - } - public class emp_obj_typ - { - public decimal empno; - public string? ename; - public addr_object_type? addr; - } -} -``` - -The following .NET types are defined to map to the types in EDB Postgres Advanced Server: - -```text -public class addr_object_type -{ -public string? street; -public string? city; -public string? state; -public decimal zip; -} - -public class emp_obj_typ -{ - public decimal empno; - public string? ename; - public addr_object_type? addr; -} -``` - -A call to `EDBDataSourceBuilder.MapComposite` maps the .NET type to the EDB Postgres Advanced Server types: - -```text -dataSourceBuilder.MapComposite("enterprisedb.addr_object_type"); -dataSourceBuilder.MapComposite("enterprisedb.emp_obj_typ"); -``` - -A call to `EDBCommandBuilder.DeriveParameters()` gets parameter information for a stored procedure. This allows you to just set the parameter values and call the stored procedure: - -```text -EDBCommandBuilder.DeriveParameters(cmd); -``` - -Set the value of the parameter by creating an object of the .NET type and assigning it to the `Value` property of the parameter: - -```text -addr_object_type address = new addr_object_type() -{ - street = "123 MAIN STREET", - city = "EDISON", - state = "NJ", - zip = 8817 -}; - -emp_obj_typ emp = new emp_obj_typ() -{ - empno = 9001, - ename = "JONES", - addr = address -}; -cmd.Parameters[0].Value = emp; -``` - -A call to `cmd.ExecuteNonQuery()` executes the call to the `display_emp()` method: - -```text -cmd.ExecuteNonQuery(); -``` diff --git a/product_docs/docs/net_connector/7.0.6.2/16_scram_compatibility.mdx b/product_docs/docs/net_connector/7.0.6.2/16_scram_compatibility.mdx deleted file mode 100644 index feff2da342b..00000000000 --- a/product_docs/docs/net_connector/7.0.6.2/16_scram_compatibility.mdx +++ /dev/null @@ -1,10 +0,0 @@ ---- -title: "Scram compatibility" -legacyRedirects: - - "/edb-docs/d/edb-postgres-net-connector/user-guides/net-guide/4.1.6.1/security_and_encryption.html" - ---- - - - -The EDB .NET driver provides SCRAM-SHA-256 support for EDB Postgres Advanced Server version 10 and later. This support is available from EDB .NET 4.0.2.1 release and later. diff --git a/product_docs/docs/net_connector/7.0.6.2/17_advanced_server_net_connector_logging.mdx b/product_docs/docs/net_connector/7.0.6.2/17_advanced_server_net_connector_logging.mdx deleted file mode 100644 index 03bd1ed820a..00000000000 --- a/product_docs/docs/net_connector/7.0.6.2/17_advanced_server_net_connector_logging.mdx +++ /dev/null @@ -1,82 +0,0 @@ ---- -title: "EDB .NET Connector logging" - ---- - - - -EDB .NET Connector supports the use of logging to help resolve issues with the .NET Connector when used in your application. EDB .NET Connector supports logging using the standard .NET `Microsoft.Extensions.Logging` package. For more information about logging in .Net, see [Logging in C# and .NET](https://learn.microsoft.com/en-us/dotnet/core/extensions/logging?tabs=command-line). - -!!! Note - For versions earlier than 7.x, EDB .NET Connector had its own, custom logging API. - -## Console logging provider - -.NET logging API works with a variety of built-in and third-party logging providers. The console logging provider logs output to the console. - -### Console logging with EDBDataSource - -Create a `Microsoft.Extensions.Logging.LoggerFactory` and configure an `EDBDataSource` with it. Any use of connections opened through this data source log using this logger factory. - -```text -var loggerFactory = LoggerFactory.Create(builder => builder.AddSimpleConsole()); - -var dataSourceBuilder = new EDBDataSourceBuilder(connectionString); -dataSourceBuilder.UseLoggerFactory(loggerFactory); -await using var dataSource = dataSourceBuilder.Build(); - -await using var connection = await dataSource.OpenConnectionAsync(); -await using var command = new EDBCommand("SELECT 1", connection); -_ = await command.ExecuteScalarAsync(); -``` - -### Console logging without EDBDataSource - -Create a `Microsoft.Extensions.Logging.LoggerFactory` and configure EDB .NET Connector's logger factory globally using `EDBLoggingConfiguration.InitializeLogging`. Configure it at the start of your program, before using any other EDB .NET Connector API. - -```text -var loggerFactory = LoggerFactory.Create(builder => builder.AddSimpleConsole()); -EDBLoggingConfiguration.InitializeLogging(loggerFactory); - -await using var conn = new EDBConnection(connectionString); -await conn.OpenAsync(); -await using var command = new EDBCommand("SELECT 1", conn); -_ = await command.ExecuteScalarAsync(); -``` - -## Log levels - -The following log levels are available: - -- Trace -- Debug -- Information -- Warning -- Error -- Fatal - -This example shows how to change the log level to `Trace`: - -```text -var loggerFactory = LoggerFactory.Create(builder => builder -.SetMinimumLevel(LogLevel.Trace -.AddSimpleConsole() -); -``` - -## Formatting the log output - -This example shows how to format your log output. Create a `LoggerFactory` to restrict each log message to a single line and add a date time to the log: - -```text -var loggerFactory = LoggerFactory.Create(builder => -builder -.SetMinimumLevel(LogLevel.Trace) -.AddSimpleConsole( - options => - { - options.SingleLine = true; - options.TimestampFormat = "yyyy/MM/dd HH:mm:ss "; - } - )); -``` \ No newline at end of file diff --git a/product_docs/docs/net_connector/7.0.6.2/18_api_reference.mdx b/product_docs/docs/net_connector/7.0.6.2/18_api_reference.mdx deleted file mode 100644 index 53050c37952..00000000000 --- a/product_docs/docs/net_connector/7.0.6.2/18_api_reference.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -title: "API reference" - ---- - - - -For information about using the API, see the [Npgsql documentation](http://www.npgsql.org/doc/api/Npgsql.html). - -Usage notes: - -- When using the API, replace references to `Npgsql` with `EnterpriseDB.EDBClient`. -- When referring to classes, replace `Npgsql` with `EDB`. For example, use the `EDBBinaryExporter` class instead of the `NpgsqlBinaryExporter` class. diff --git a/product_docs/docs/net_connector/7.0.6.2/images/connection_opened_successfully.png b/product_docs/docs/net_connector/7.0.6.2/images/connection_opened_successfully.png deleted file mode 100755 index bab12126d20..00000000000 --- a/product_docs/docs/net_connector/7.0.6.2/images/connection_opened_successfully.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:537e7edecce3882b794110e0ffc644a51cab69ba2c7e7f82a3e99d32c4b4ba65 -size 22683 diff --git a/product_docs/docs/net_connector/7.0.6.2/images/dialog.png b/product_docs/docs/net_connector/7.0.6.2/images/dialog.png deleted file mode 100755 index 19cba54d1f9..00000000000 --- a/product_docs/docs/net_connector/7.0.6.2/images/dialog.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:f922e6cd4e43927708b5f460f5389a5b3a41dd70f3a5394723e6aee7d710f1ae -size 9048 diff --git a/product_docs/docs/net_connector/7.0.6.2/images/dotnet_installation_complete.png b/product_docs/docs/net_connector/7.0.6.2/images/dotnet_installation_complete.png deleted file mode 100755 index 332ae795899..00000000000 --- a/product_docs/docs/net_connector/7.0.6.2/images/dotnet_installation_complete.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:0983f216ce071f57f7e758980c3f966caded4312412905a6aba66efa362fdb13 -size 272137 diff --git a/product_docs/docs/net_connector/7.0.6.2/images/dotnet_installation_dialog.png b/product_docs/docs/net_connector/7.0.6.2/images/dotnet_installation_dialog.png deleted file mode 100755 index b465d536032..00000000000 --- a/product_docs/docs/net_connector/7.0.6.2/images/dotnet_installation_dialog.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:994a725f061f1b51fd92ccc2df5abd9066a1cf4ea7600611ae57ebc6cc59af20 -size 51144 diff --git a/product_docs/docs/net_connector/7.0.6.2/images/dotnet_installation_wizard.png b/product_docs/docs/net_connector/7.0.6.2/images/dotnet_installation_wizard.png deleted file mode 100755 index 29c9a7f99f9..00000000000 --- a/product_docs/docs/net_connector/7.0.6.2/images/dotnet_installation_wizard.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:efe8029105db01662005a349a7b59c87b6f7dce3017990a197e3b9b681392860 -size 227235 diff --git a/product_docs/docs/net_connector/7.0.6.2/images/ready_to_install.png b/product_docs/docs/net_connector/7.0.6.2/images/ready_to_install.png deleted file mode 100755 index 59e44d96bc5..00000000000 --- a/product_docs/docs/net_connector/7.0.6.2/images/ready_to_install.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:91b18bef7b78a6dae7d6b664e2bccfbfdb4248dbd034cb59e2c6a35ada7da49c -size 44080 diff --git a/product_docs/docs/net_connector/7.0.6.2/images/selecting_the_connectors_installer.png b/product_docs/docs/net_connector/7.0.6.2/images/selecting_the_connectors_installer.png deleted file mode 100755 index 432e4473c09..00000000000 --- a/product_docs/docs/net_connector/7.0.6.2/images/selecting_the_connectors_installer.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:d939c7e6604025f82be47969d69e6acc63ab5a48a0af4341e42efe0156b42778 -size 97808 diff --git a/product_docs/docs/net_connector/7.0.6.2/images/starting_stackbuilder_plus.png b/product_docs/docs/net_connector/7.0.6.2/images/starting_stackbuilder_plus.png deleted file mode 100755 index 11665300652..00000000000 --- a/product_docs/docs/net_connector/7.0.6.2/images/starting_stackbuilder_plus.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:ce6bcefb865ca14239fb7e0e2ac5149ed56251cfbc5153869070d039f70857c6 -size 91989 diff --git a/product_docs/docs/net_connector/7.0.6.2/index.mdx b/product_docs/docs/net_connector/7.0.6.2/index.mdx deleted file mode 100644 index 463008600b2..00000000000 --- a/product_docs/docs/net_connector/7.0.6.2/index.mdx +++ /dev/null @@ -1,20 +0,0 @@ ---- -title: "EDB .NET Connector" -directoryDefaults: - description: "EDB .NET Connector version 7.0.6.2 documentation and release notes." -pdf: true ---- - -The EDB .NET Connector distributed with EDB Postgres Advanced Server provides connectivity between a .NET client application and an EDB Postgres Advanced Server database server. You can: - -- Connect to an instance of EDB Postgres Advanced Server. -- Retrieve information from an EDB Postgres Advanced Server database. -- Update information stored on an EDB Postgres Advanced Server database. - -To understand these examples, you need a solid working knowledge of C# and .NET. The EDB .NET Connector functionality is built on the core functionality of the Npgsql open source project. For details, see the [Npgsql User Guide](http://www.npgsql.org/doc/index.html). - -
- -release_notes requirements_overview the_advanced_server_net_connector_overview installing_and_configuring_the_net_connector using_the_net_connector opening_a_database_connection retrieving_database_records parameterized_queries inserting_records_in_a_database deleting_records_in_a_database using_spl_stored_procedures_in_your_net_application using_advanced_queueing using_a_ref_cursor_in_a_net_application using_plugins using_object_types scram_compatibility advanced_server_net_connector_logging api_reference conclusion - -
diff --git a/product_docs/docs/net_connector/8.0.2.1/02_requirements_overview.mdx b/product_docs/docs/net_connector/8.0.2.1/02_requirements_overview.mdx deleted file mode 100644 index fbd750391e3..00000000000 --- a/product_docs/docs/net_connector/8.0.2.1/02_requirements_overview.mdx +++ /dev/null @@ -1,20 +0,0 @@ ---- -title: "Product compatibility" ---- - - - -These are the supported versions and platforms for the EDB .NET Connector. - -The EDB .NET Connector is certified with EDB Postgres Advanced Server version 11 and later. - -The EDB .NET Connector graphical installers are supported on the following Windows platforms: - -64-bit Windows: - -- Windows Server 2019 and 2022 -- Windows 10 and 11 - -32-bit Windows: - -- Windows 10 diff --git a/product_docs/docs/net_connector/8.0.2.1/03_the_advanced_server_net_connector_overview.mdx b/product_docs/docs/net_connector/8.0.2.1/03_the_advanced_server_net_connector_overview.mdx deleted file mode 100644 index fda8a0fd09a..00000000000 --- a/product_docs/docs/net_connector/8.0.2.1/03_the_advanced_server_net_connector_overview.mdx +++ /dev/null @@ -1,41 +0,0 @@ ---- -title: "EDB .NET Connector overview" - ---- - - - -EDB .NET Connector is a .NET data provider that allows a client application to connect to a database stored on an EDB Postgres Advanced Server host. The .NET Connector accesses the data directly, allowing the client application optimal performance, a broad spectrum of functionality, and access to EDB Postgres Advanced Server features. - -The .NET Connector supports the following frameworks: - -- .NET 8.0 -- .NET 7.0 -- .NET 6.0 -- .NET Framework 4.7.2, 4.8, and 4.8.1 -- .NET Standard 2.0 and 2.1 - - -## The .NET class hierarchy - -The .NET class hierarchy contains classes that you can use to create objects that control a connection to the EDB Postgres Advanced Server database and manipulate the data stored on the server. The following are a few of the most commonly used object classes. - -`EDBDataSource` - - `EDBDataSource` is the entry point for all the connections made to the database. It's responsible for issuing connections to the server and efficiently managing them. Starting with EDB .NET Connector 7.0.4.1, you no longer need direct instantiation of `EDBConnection`. Instantiate `EDBDataSource` and use the method provided to create commands or execute queries. - -`EDBConnection` - - The `EDBConnection` class represents a connection to EDB Postgres Advanced Server. An `EDBConnection` object contains a `ConnectionString` that tells the .NET client how to connect to an EDB Postgres Advanced Server database. Obtain `EDBConnection` from an `EDBDataSource` instance, and use it directly only in specific scenarios, such as transactions. - -`EDBCommand` - - An `EDBCommand` object contains a SQL command that the client executes against EDB Postgres Advanced Server. Before you can execute an `EDBCommand` object, you must link it to an `EDBConnection` object. - -`EDBDataReader` - - An `EDBDataReader` object provides a way to read an EDB Postgres Advanced Server result set. You can use an `EDBDataReader` object to step through one row at a time, forward only. - -`EDBDataAdapter` - - An `EDBDataAdapter` object links a result set to the EDB Postgres Advanced Server database. You can modify values and use the `EDBDataAdapter` class to update the data stored in an EDB Postgres Advanced Server database. diff --git a/product_docs/docs/net_connector/8.0.2.1/04_installing_and_configuring_the_net_connector.mdx b/product_docs/docs/net_connector/8.0.2.1/04_installing_and_configuring_the_net_connector.mdx deleted file mode 100644 index cbc235e744c..00000000000 --- a/product_docs/docs/net_connector/8.0.2.1/04_installing_and_configuring_the_net_connector.mdx +++ /dev/null @@ -1,320 +0,0 @@ ---- -title: "Installing and configuring the .NET Connector" - ---- - - - -## Installing the .NET Connector - -You can install the EDB .NET Connector using either the EDB installer or the installer from NuGet.org. - -### Installing and configuring the .NET Connector from NuGet.org - -#### Install NuGet package via command line - -Launch a terminal from your solution folder and run: - -```text -dotnet add package EnterpriseDB.EDBClient -``` - -This command downloads and installs the EDB .NET Connector matching your .NET version. Your project is then ready to import the EDB .NET Connector namespace: - -```text -using EnterpriseDB.EDBClient; -``` - -You can find all the EDB .NET Connector satellite packages at [NuGet.org](https://www.nuget.org/profiles/EnterpriseDB). - -For more information, see the [EDB .NET Connector Now Published on NuGet](https://www.enterprisedb.com/blog/improving-developer-experience-updated-edb-net-connector-now-published-nuget) blog post. - -#### Install NuGet package via Visual Studio interface - -1. Right-click your project or solution and select **Manage NuGet package**. -1. Search the package using `enterprisedb.edbclient` as the search text. -1. Select the EnterpriseDB.EDBClient package. -1. Select **Install** to proceed to package download and installation. - -This command downloads and installs the EDB .NET Connector matching your .NET version. Your project is then ready to import the EDB .NET Connector namespace: - -```text -using EnterpriseDB.EDBClient; -``` - -For more information, see the [EDB .NET Connector Now Published on NuGet](https://www.enterprisedb.com/blog/improving-developer-experience-updated-edb-net-connector-now-published-nuget) blog post. - -### Installing the .NET Connector using EDB installer - -You can use the EDB .NET Connector installer to add the .NET Connector to your system. The installer is available from [the EDB website](https://www.enterprisedb.com/software-downloads-postgres). - -1. After downloading the installer, right-click the installer icon, and select **Run As Administrator**. When prompted, select an installation language and select **OK** to continue to the Setup window. - - ![The .NET Connector Installation wizard](images/dotnet_installation_wizard.png) - -1. Select **Next**. - - ![The Installation dialog box](images/dotnet_installation_dialog.png) - -1. Use the Installation Directory dialog box to specify the directory in which to install the connector. Select **Next**. - - ![The Ready to Install dialog box](images/ready_to_install.png) - -1. To start the installation, on the Ready to Install dialog box, select **Next**. Popups confirm the progress of the installation wizard. - - ![The installation is complete](images/dotnet_installation_complete.png) - -1. When the wizard informs you that it has completed the setup, select **Finish**. - -You can also use StackBuilder Plus to add or update the connector on an existing EDB Postgres Advanced Server installation. - -1. To open StackBuilder Plus, from the Windows **Apps** menu, select **StackBuilder Plus**. - - ![Starting StackBuilder Plus](images/starting_stackbuilder_plus.png) - -1. When StackBuilder Plus opens, follow the onscreen instructions. - -1. From the Database Drivers node of the tree control, select the **EnterpriseDB.Net Connector** option. - - ![Selecting the Connectors installer](images/selecting_the_connectors_installer.png) - -1. Follow the directions of the onscreen wizard to add or update an installation of an EDB Connector. - -### Configuring the .NET Connector - -For information about configuring the .NET Connector in each environment, see: - -- **Referencing the Library Files.** [General configuration information](#referencing_the_library_files) applicable to all components. -- **.NET 8.0** Instructions for configuring for use with [.NET 8.0](#setup_8_0). -- **.NET 7.0** Instructions for configuring for use with [.NET 7.0](#setup_7_0). -- **.NET 6.0** Instructions for configuring for use with [.NET 6.0](#setup_6_0). -- **.NET Framework 4.7.2** Instructions for configuring for use with [.NET framework 4.7.2](#net-framework-472). -- **.NET Framework 4.8** Instructions for configuring for use with [.NET Framework 4.8](#net-framework-48). -- **.NET Framework 4.8.1** Instructions for configuring for use with [.NET Framework 4.8.1](#net-framework-481). -- **.NET Standard 2.0** Instructions for configuring for use with [.NET Standard 2.0](#standard_setup_2_0). -- **.NET Standard 2.1** Instructions for configuring for use with [.NET Standard 2.1](#standard_setup_2_1). -- **.NET EntityFramework Core** Instructions for configuring for use with [.NET EntityFramework Core](#entity_setup). - -#### Referencing the library files - - - -To reference library files with Microsoft Visual Studio: - -1. In the Solution Explorer, select the project. -2. Select **Project > Add Reference**. -3. In the Add Reference dialog box, browse to select the appropriate library files. - -Optionally, you can copy the library files to the specified location. - -Before you can use an EDB .NET class, you must import the namespace into your program. Importing a namespace makes the compiler aware of the classes available in the namespace. The namespace is `EnterpriseDB.EDBClient`. - -The method you use to include the namespace varies by the type of application you're writing. For example, the following command imports a namespace into an `ASP.NET` page: - -```text - <% import namespace="EnterpriseDB.EDBClient" %> -``` - -To import a namespace into a C# application, use: - -```text - using EnterpriseDB.EDBClient; -``` - -#### .NET framework setup - -Each .NET version has specific setup instructions. - - - -##### .NET 8.0 - -For .NET 8.0, the data provider installation path is: - -`C:\Program Files\edb\dotnet\net8.0\` - -You must add the following dependencies to your project: - -`EnterpriseDB.EDBClient.dll` - -Depending upon the type of application you use, you may be required to import the namespace into the source code. See [Referencing the library files](#referencing_the_library_files) for this and other information about referencing library files. - - - -##### .NET 7.0 - -For .NET 7.0, the data provider installation path is `C:\Program Files\edb\dotnet\net7.0\`. - -You must add the following dependencies to your project: - -- `EnterpriseDB.EDBClient.dll` - -Depending on your application type, you might need to import the namespace into the source code. See [Referencing the library files](#referencing_the_library_files) for this and the other information about referencing the library files. - - - -##### .NET 6.0 - -For .NET 6.0, the data provider installation path is: - - `C:\Program Files\edb\dotnet\net6.0\` - -You must add the following dependencies to your project: - -- `EnterpriseDB.EDBClient.dll` - -Depending on your application type, you might need to import the namespace into the source code. See [Referencing the library files](#referencing_the_library_files) for this and the other information about referencing library files. - - - -##### .NET Framework 4.7.2 - -For .NET Framework 4.7.2, the data provider installation path is: - - `C:\Program Files\edb\dotnet\net472\`. - -You must add the following dependency to your project. You may also need to add other dependencies from the same directory: - -- `EnterpriseDB.EDBClient.dll` - -Depending on your application type, you might need to import the namespace into the source code. See [Referencing the library files](#referencing_the_library_files) for this and the other information about referencing the library files. - -##### .NET Framework 4.8 - -For .NET Framework 4.8, the data provider installation path is: - - `C:\Program Files\edb\dotnet\net48\`. - -You must add the following dependency to your project. You may also need to add other dependencies from the same directory: - -- `EnterpriseDB.EDBClient.dll` - -Depending on your application type, you might need to import the namespace into the source code. See [Referencing the library files](#referencing_the_library_files) for this and the other information about referencing the library files. - -##### .NET Framework 4.8.1 - -For .NET Framework 4.8.1, the data provider installation path is: - - `C:\Program Files\edb\dotnet\net481\`. - -You must add the following dependency to your project. You may also need to add other dependencies from the same directory: - -- `EnterpriseDB.EDBClient.dll` - -Depending on your application type, you might need to import the namespace into the source code. See [Referencing the library files](#referencing_the_library_files) for this and the other information about referencing the library files. - - - -##### .NET Standard 2.0 - -For .NET Standard Framework 2.0, the data provider installation path is: - - `C:\Program Files\edb\dotnet\netstandard2.0\`. - -You must add the following dependencies to your project: - -- `EnterpriseDB.EDBClient.dll` - -- `System.Threading.Tasks.Extensions.dll` - -- `System.Runtime.CompilerServices.Unsafe.dll` - -- `System.ValueTuple.dll` - -Depending on your application type, you might need to import the namespace into the source code. See [Referencing the library files](#referencing_the_library_files) for this and the other information about referencing the library files. - - - -##### .NET Standard 2.1 - -For .NET Standard Framework 2.1, the data provider installation path is `C:\Program Files\edb\dotnet\netstandard2.1\`. - -The following shared library files are required: - -- `EnterpriseDB.EDBClient.dll` - -- `System.Memory.dll` - -- `System.Runtime.CompilerServices.Unsafe.dll` - -- `System.Text.Json.dll` - -- `System.Threading.Tasks.Extensions.dll` - -- `System.ValueTuple.dll` - -Depending on your application type, you might need to import the namespace into the source code. See [Referencing the library files](#referencing_the_library_files) for this and the other information about referencing the library files. - - - -##### .NET Entity Framework Core - -To configure the .NET Connector for use with Entity Framework Core, the data provider installation path is: - -`C:\Program Files\edb\dotnet\EF.Core\EFCore.PG\net8.0` -The following shared library file is required: - -- `EnterpriseDB.EDBClient.EntityFrameworkCore.PostgreSQL.dll` - -See [Referencing the library files](#referencing_the_library_files) for information about referencing the library files. - -The following NuGet packages are required: - -- `Microsoft.EntityFrameworkCore.Design` - -- `Microsoft.EntityFrameworkCore.Relational` - -- `Microsoft.EntityFrameworkCore.Abstractions` - - -For usage information about Entity Framework Core, see the [Microsoft documentation](https://learn.microsoft.com/en-us/ef/core/). - -**Prerequisite** - -To open a command prompt: - -Select **Tools > Command Line > Developer Command Prompt**. - -Install dotnet-ef (using the command prompt), - - `dotnet tool install --global dotnet-ef` - -**Sample project** - -Create a new Console Application based on .NET 8.0. - -Add Reference to the following EDB assemblies: - -- `EnterpriseDB.EDBClient.EntityFrameworkCore.PostgreSQL.dll` - -- `EnterpriseDB.EDBClient.dll` - -Add the following NuGet packages: - -- `Microsoft.EntityFrameworkCore.Design` - -- `Microsoft.EntityFrameworkCore.Relational` - -- `Microsoft.EntityFrameworkCore.Abstractions` - -**Database-first scenario** - -Issue the following command to create model classes corresponding to all objects in the specified database: - -```text -dotnet ef dbcontext scaffold Host=;Database=;Username=;Password=;Port= EnterpriseDB.EDBClient.EntityFrameworkCore.PostgreSQL -o Models -``` - -**Code-first scenario** - -Add code for defining a DbContext and create, read, update, and delete operations. - -For more details, see the Microsoft documentation. - -Issue the following commands to create the initial database and tables: - -```text - dotnet ef migrations add InitialCreate --context BloggingContext - - dotnet ef database update --context BloggingContext -``` diff --git a/product_docs/docs/net_connector/8.0.2.1/05_using_the_net_connector.mdx b/product_docs/docs/net_connector/8.0.2.1/05_using_the_net_connector.mdx deleted file mode 100644 index bba3c8d70ec..00000000000 --- a/product_docs/docs/net_connector/8.0.2.1/05_using_the_net_connector.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -title: "Using the .NET Connector" - ---- - - - -These examples show how you can use the EDB object classes that are provided by the EDB .NET Connector. These object classes allow a .NET application to connect to and interact with an EDB Postgres Advanced Server database. - -To use these examples, place the .NET library files in the same directory as the compiled form of your application. All of these examples are written in C#, and each is embedded in an ASP.NET page. The same logic and code applies to other .NET applications (WinForm or console applications, for example). - -Create and save the following `web.config` file in the same directory as the sample code. The examples make use of the `DB_CONN_STRING` key from this configuration file to return a connection string from the EDB Postgres Advanced Server host. - -```text - - - - - - -``` - -An EDB Postgres Advanced Server connection string for an ASP.NET web application is stored in the `web.config` file. If you're writing an application that doesn't use ASP.NET, provide the connection information in an application configuration file, such as `app.config`. diff --git a/product_docs/docs/net_connector/8.0.2.1/06_opening_a_database_connection.mdx b/product_docs/docs/net_connector/8.0.2.1/06_opening_a_database_connection.mdx deleted file mode 100644 index b1a8da3eca9..00000000000 --- a/product_docs/docs/net_connector/8.0.2.1/06_opening_a_database_connection.mdx +++ /dev/null @@ -1,278 +0,0 @@ ---- -title: "Opening a database connection" - ---- - - - -An `EDBConnection` object is responsible for handling the communication between an instance of EDB Postgres Advanced Server and a .NET application. Before you can access data stored in an EDB Postgres Advanced Server database, you must create and open an `EDBConnection` object. - -## Creating an EDBConnection object - -You can open a connection using one of the following approaches. In either case, you must import the namespace `EnterpriseDB.EDBClient`. - -### Connection with a data source - -1. Create an instance of the `EDBDataSource` object using a connection string as a parameter to the create method of the `EDBDataSource` class. - -2. To open a connection, call the `OpenConnection` method of the `EDBDataSource` object. - -This example shows how to open a connection using a data source: - - ```text - await using var dataSource = EDBDataSource.Create(ConnectionString); - var connection = dataSource.OpenConnection(); - ``` - -### Connection without a data source - -1. Create an instance of the `EDBConnection` object using a connection string as a parameter to the constructor of the `EDBConnection` class. - -2. Call the `Open` method of the `EDBConnection` object to open the connection. - -This example shows how to open a connection without a data source: - - ```text - EDBConnection conn = new EDBConnection(ConnectionString); - conn.Open(); - ``` - -!!! Note - For `EnterpriseDB.EDBClient 7.0.4` and later, we recommend `EDBDataSource` to connect to EDB Postgres Advanced Server database or execute SQL directly against it. For more information on the data source, see the [Npgsql documentation](https://www.npgsql.org/doc/basic-usage.html). - - - - -## Connection string parameters - -A valid connection string specifies location and authentication information for an EDB Postgres Advanced Server instance. You must provide the connection string before opening the connection. A connection string must contain: - -- The name or IP address of the server -- The name of the EDB Postgres Advanced Server database -- The name of an EDB Postgres Advanced Server user -- The password associated with that user - -You can include the following parameters in the connection string: - -`CommandTimeout` - - `CommandTimeout` specifies the length of time (in seconds) to wait for a command to finish executing before throwing an exception. The default value is `20`. - -`ConnectionLifeTime` - - Use `ConnectionLifeTime` to specify the length of time (in seconds) to wait before closing unused connections in the pool. The default value is `15`. - -`Database` - - Use the `Database` parameter to specify the name of the database for the application to connect to. The default is the name of the connecting user. - -`Encoding` - - The `Encoding` parameter is obsolete. The parameter always returns the string `unicode` and silently ignores attempts to set it. - -`Integrated Security` - - Specify a value of `true` to use Windows Integrated Security. By default, `Integrated Security` is set to `false`, and Windows Integrated Security is disabled. - -`Load Role Based Tables` - - Use `Load Role Based Tables` to load table OIDs based on role. This change affects only the loading of table type OID and not the composite type. Setting this parameter to `true` triggers the new functionality. The default value is `false`. - -`MaxPoolSize` - - `MaxPoolSize` instructs `EDBConnection` to dispose of pooled connections when the pool exceeds the specified number of connections. The default value is `20`. - -`MinPoolSize` - - `MinPoolSize` instructs `EDBConnection` to preallocate the specified number of connections with the server. The default value is `1`. - -`Password` - - When using clear text authentication, specify the password to use to establish a connection with the server. - -`Pooling` - - Specify a value of `false` to disable connection pooling. By default, `Pooling` is set to `true` to enable connection pooling. - -`No Reset On Close` - -When `Pooling` is enabled and the connection is closed, reopened, and the underlying connection is reused, then some operations are executed to discard the previous connection resources. You can override this behavior by enabling `No Reset On Close`. - -`Port` - - The `Port` parameter specifies the port for the application to connect to. - -`Protocol` - - The specific protocol version to use (instead of automatic). Specify an integer value of `2` or `3`. - -`SearchPath` - - Use the `SearchPath` parameter to change the search path to named and public schemas. - -`Server` - - The name or IP address of the EDB Postgres Advanced Server host. - -`SSL` - - Specify a value of `true` to attempt a secure connection. By default, `SSL` is set to `false`. - -`sslmode` - - Use `sslmode` to specify an SSL connection control preference. `sslmode` can be: - -- `prefer` — Use SSL if possible. - -- `require` — Throw an exception if an SSL connection can't be established. - -- `allow` — Connect without SSL. This parameter isn't supported. - -- `disable` — Don't attempt an SSL connection. This is the default behavior. - -`SyncNotification` - - Use the `SyncNotification` parameter to specify for `EDBDataprovider` to use synchronous notifications. The default value is `false`. - -`Timeout` - - `Timeout` specifies the length of time (in seconds) to wait for an open connection. The default value is `15`. - -`User Id` - - The `User Id` parameter specifies the user name to use for the connection. - -## Example: Opening a database connection using ASP.NET - -This example shows how to open a connection to an instance of EDB Postgres Advanced Server and then close the connection. The connection is established using the credentials specified in the `DB_CONN_STRING` configuration parameter. See [Using the .Net Connector](05_using_the_net_connector/#using_the_net_connector) for an introduction to connection information. Also see [Connection string parameters](#connection-string-parameters) for connection parameters. - -```cpp -<% @ Page Language="C#" %> -<% @Import Namespace="EnterpriseDB.EDBClient" %> -<% @Import Namespace="System.Configuration" %> - -``` - -If the connection is successful, a message appears indicating that the connection opened successfully. - -## Example: Opening a database connection from a console application - -This example opens a connection with an EDB Postgres Advanced Server database using a console-based application. - -Before writing the code for the console application, create an `app.config` file that stores the connection string to the database. Using a configuration file makes it convenient to update the connection string if the information changes. - -```ini - - - - - - -``` - -Enter the following code sample into a file: - -```csharp -using System; -using System.Data; -using EnterpriseDB.EDBClient; -using System.Configuration; -namespace EnterpriseDB -{ - class EDB - { - static void Main(string[] args) - { - var strConnectionString = ConfigurationManager.AppSettings["DB_CONN_STRING"]; - try - { - await using var dataSource = EDBDataSource.Create(strConnectionString); - var conn = dataSource.OpenConnection(); - Console.WriteLine("Connection Opened Successfully"); - conn.Close(); - } - catch(Exception exp) - { - throw new Exception(exp.ToString()); - } - } - } -} -``` - -Save the file as `EDBConnection-Sample.cs` and compile it with the following command: - -```text -csc /r:EnterpriseDB.EDBClient.dll /out:Console.exe EDBConnection-Sample.cs` -``` - -Compiling the sample generates a `Console.exe` file. You can execute the sample code by entering `Console.exe`. When executed, the console verifies that it opened successfully. - -## Example: Opening a database connection from a Windows form application - -This example opens a database connection using a .NET WinForm application. To use the example, save the following code as `WinForm-Example.cs` in a directory that contains the library files: - -```csharp -using System; -using System.Windows.Forms; -using System.Drawing; -using EnterpriseDB.EDBClient; -namespace EDBTestClient -{ - class Win_Conn - { - static void Main(string[] args) - { - Form frmMain = new Form(); - Button btnConn = new Button(); - btnConn.Location = new System.Drawing.Point(104, 64); - btnConn.Name = "btnConn"; - btnConn.Text = "Open Connection"; - btnConn.Click += new System.EventHandler(btnConn_Click); - frmMain.Controls.Add(btnConn); - frmMain.Text = "EnterpriseDB"; - Application.Run(frmMain); - } - private static void btnConn_Click(object sender, System.EventArgs e) - { - try - { - var strConnectionString = "Server=localhost;port=5444;username=edb;password=edb;database=edb"; - await using var dataSource = EDBDataSource.Create(strConnectionString); - var conn = dataSource.OpenConnection(); - MessageBox.Show("Connection Opened Successfully"); - conn.Close(); - } - catch(EDBException exp) - { - MessageBox.Show(exp.ToString()); - } - } - } -} -``` - -Change the database connection string to point to the database that you want to connect to. Then compile the file with the following command: - -```text -csc /r:EnterpriseDB.EDBClient.dll /out:WinForm.exe WinForm-Example.cs -``` - -This command generates a `WinForm.exe` file in the same folder that the executable was compiled under. Invoking the executable displays a message that the connection was successful. diff --git a/product_docs/docs/net_connector/8.0.2.1/07_retrieving_database_records.mdx b/product_docs/docs/net_connector/8.0.2.1/07_retrieving_database_records.mdx deleted file mode 100644 index 5f929c75050..00000000000 --- a/product_docs/docs/net_connector/8.0.2.1/07_retrieving_database_records.mdx +++ /dev/null @@ -1,102 +0,0 @@ ---- -title: "Retrieving database records" - ---- - - - -You can use a `SELECT` statement to retrieve records from the database using a `SELECT` command. To execute a `SELECT` statement you must: - -1. Create and open a database connection. -1. Create an `EDBCommand` object that represents the `SELECT` statement. -1. Execute the command with the `ExecuteReader()` method of the `EDBCommand` object returning `EDBDataReader`. -1. Loop through the `EDBDataReader`, displaying the results or binding the `EDBDataReader` to some control. - -An `EDBDataReader` object represents a forward-only and read-only stream of database records, presented one record at a time. To view a subsequent record in the stream, you must call the `Read()` method of the `EDBDataReader` object. - -The example that follows: - -1. Imports the EDB Postgres Advanced Server namespace `EnterpriseDB.EDBClient`. -2. Initializes an `EDBCommand` object with a `SELECT` statement. -3. Opens a connection to the database. -4. Executes the `EDBCommand` by calling the `ExecuteReader` method of the `EDBCommand` object. - -The results of the SQL statement are retrieved into an `EDBDataReader` object. - -Loop through the contents of the `EDBDataReader` object to display the records returned by the query in a `WHILE` loop. - -The `Read()` method advances to the next record (if there is one) and returns `true` if a record exists. It returns `false` if `EDBDataReader` has reached the end of the result set. - -```cpp -<% @ Page Language="C#" %> -<% @Import Namespace="EnterpriseDB.EDBClient" %> -<% @Import Namespace="System.Data" %> -<% @Import Namespace="System.Configuration" %> - - -``` - -To exercise the sample code, save the code in your default web root directory in a file named `selectEmployees.aspx`. Then, to invoke the program, enter the following in a browser: `http://localhost/selectEmployees.aspx`. - -## Retrieving a single database record - -To retrieve a single result from a query, use the `ExecuteScalar()` method of the `EDBCommand` object. The `ExecuteScalar()` method returns the first value of the first column of the first row of the `DataSet` generated by the specified query. - -```cpp -<% @ Page Language="C#" %> -<% @Import Namespace="EnterpriseDB.EDBClient" %> -<% @Import Namespace="System.Data" %> -<% @Import Namespace="System.Configuration" %> - -``` - -Save the sample code in a file named `selectscalar.aspx` in a web root directory. - -To invoke the sample code, enter the following in a browser: `http://localhost/selectScalar.aspx` - -The sample includes an explicit conversion of the value returned by the `ExecuteScalar()` method. The `ExecuteScalar()` method returns an object. To view the object, you must convert it to an integer value by using the `Convert.ToInt32` method. diff --git a/product_docs/docs/net_connector/8.0.2.1/08_parameterized_queries.mdx b/product_docs/docs/net_connector/8.0.2.1/08_parameterized_queries.mdx deleted file mode 100644 index c6e393c296f..00000000000 --- a/product_docs/docs/net_connector/8.0.2.1/08_parameterized_queries.mdx +++ /dev/null @@ -1,47 +0,0 @@ ---- -title: "Parameterized queries" - ---- - - - -A _parameterized query_ is a query with one or more parameter markers embedded in the SQL statement. Before executing a parameterized query, you must supply a value for each marker found in the text of the SQL statement. - -Parameterized queries are useful when you don't know the complete text of a query when you write your code. For example, the value referenced in a `WHERE` clause can be calculated from user input. - -As shown in the following example, you must declare the data type of each parameter specified in the parameterized query by creating an `EDBParameter` object and adding that object to the command's parameter collection. Then, you must specify a value for each parameter by calling the parameter's `Value()` function. - -The example shows using a parameterized query with an `UPDATE` statement that increases an employee salary: - -```cpp -<% @ Page Language="C#" Debug="true"%> -<% @Import Namespace="EnterpriseDB.EDBClient" %> -<% @Import Namespace="System.Data" %> -<% @Import Namespace="System.Configuration" %> - -``` - -Save the sample code in a file named `updateSalary.aspx` in a web root directory. - -To invoke the sample code, enter the following in a browser: `http://localhost/updateSalary.aspx` diff --git a/product_docs/docs/net_connector/8.0.2.1/09_inserting_records_in_a_database.mdx b/product_docs/docs/net_connector/8.0.2.1/09_inserting_records_in_a_database.mdx deleted file mode 100644 index 228224eb3b8..00000000000 --- a/product_docs/docs/net_connector/8.0.2.1/09_inserting_records_in_a_database.mdx +++ /dev/null @@ -1,47 +0,0 @@ ---- -title: "Inserting records in a database" - ---- - - - -You can use the `ExecuteNonQuery()` method of `EDBCommand` to add records to a database stored on an EDB Postgres Advanced Server host with an `INSERT` command. - -In the example that follows, the `INSERT` command is stored in the variable `cmd`. The values prefixed with a colon (`:`) are placeholders for `EDBParameters` that are instantiated, assigned values, and then added to the `INSERT` command's parameter collection in the statements that follow. The `INSERT` command is executed by the `ExecuteNonQuery()` method of the `cmdInsert` object. - -The example adds an employee to the `emp` table: - -```cpp -<% @ Page Language="C#" Debug="true"%> -<% @Import Namespace="EnterpriseDB.EDBClient" %> -<% @Import Namespace="System.Data" %> -<% @Import Namespace="System.Configuration" %> - -``` - -Save the sample code in a file named `insertEmployee.aspx` in a web root directory. - -To invoke the sample code, enter the following in a browser: `http://localhost/insertEmployee.aspx` diff --git a/product_docs/docs/net_connector/8.0.2.1/10_deleting_records_in_a_database.mdx b/product_docs/docs/net_connector/8.0.2.1/10_deleting_records_in_a_database.mdx deleted file mode 100644 index 8c797af0868..00000000000 --- a/product_docs/docs/net_connector/8.0.2.1/10_deleting_records_in_a_database.mdx +++ /dev/null @@ -1,44 +0,0 @@ ---- -title: "Deleting records in a database" - ---- - - - -You can use the `ExecuteNonQuery()` method of `EDBCommand` to delete records from a database stored on an EDB Postgres Advanced Server host with a `DELETE` statement. - -In the example that follows, the `DELETE` command is stored in the variable `strDeleteQuery`. The code passes the employee number specified by `EmpNo` to the `DELETE` command. The command is then executed using the `ExecuteNonQuery()` method. - -```cpp -<% @ Page Language="C#" Debug="true"%> -<% @Import Namespace="EnterpriseDB.EDBClient" %> -<% @Import Namespace="System.Data" %> -<% @Import Namespace="System.Configuration" %> - -``` - -Save the sample code in a file named `deleteEmployee.aspx` in a web root directory. - -To invoke the sample code, enter the following in a browser: `http://localhost/deleteEmployee.aspx` diff --git a/product_docs/docs/net_connector/8.0.2.1/11_using_spl_stored_procedures_in_your_net_application.mdx b/product_docs/docs/net_connector/8.0.2.1/11_using_spl_stored_procedures_in_your_net_application.mdx deleted file mode 100644 index 656a3f32936..00000000000 --- a/product_docs/docs/net_connector/8.0.2.1/11_using_spl_stored_procedures_in_your_net_application.mdx +++ /dev/null @@ -1,340 +0,0 @@ ---- -title: "Using SPL stored procedures in your .NET application" - ---- - - - -You can include SQL statements in an application in two ways: - -- By adding the SQL statements directly in the .NET application code -- By packaging the SQL statements in a stored procedure and executing the stored procedure from the .NET application - -In some cases, a stored procedure can provide advantages over embedded SQL statements. Stored procedures support complex conditional and looping constructs that are difficult to duplicate with SQL statements embedded directly in an application. - -You can also see an improvement in performance by using stored procedures. A stored procedure needs to be parsed, compiled, and optimized only once on the server side. A SQL statement that's included in an application might be parsed, compiled, and optimized each time it's executed from a .NET application. - -To use a stored procedure in your .NET application you must: - -1. Create an SPL stored procedure on the EDB Postgres Advanced Server host. -2. Import the `EnterpriseDB.EDBClient` namespace. -3. Pass the name of the stored procedure to the instance of the `EDBCommand`. -4. Change the `EDBCommand.CommandType` to `CommandType.StoredProcedure`. -5. `Prepare()` the command. -6. Execute the command. - -## Example: Executing a stored procedure without parameters - -This sample procedure prints the name of department 10. The procedure takes no parameters and returns no parameters. To create the sample procedure, invoke EDB-PSQL and connect to the EDB Postgres Advanced Server host database. Enter the following SPL code at the command line: - -```sql -CREATE OR REPLACE PROCEDURE list_dept10 -IS - v_deptname VARCHAR2(30); -BEGIN - DBMS_OUTPUT.PUT_LINE('Dept No: 10'); - SELECT dname INTO v_deptname FROM dept WHERE deptno = 10; - DBMS_OUTPUT.PUT_LINE('Dept Name: ' || v_deptname); -END; -``` - -When EDB Postgres Advanced Server validates the stored procedure, it echoes `CREATE PROCEDURE`. - -### Using the EDBCommand object to execute a stored procedure - -The `CommandType` property of the `EDBCommand` object indicates the type of command being executed. The `CommandType` property is set to one of three possible `CommandType` enumeration values: - -- Use the default `Text` value when passing a SQL string for execution. -- Use the `StoredProcedure` value, passing the name of a stored procedure for execution. -- Use the `TableDirect` value when passing a table name. This value passes back all records in the specified table. - -The `CommandText` property must contain a SQL string, stored procedure name, or table name, depending on the value of the `CommandType` property. - -This example executes the stored procedure: - -```cpp -<% @ Page Language="C#" Debug="true"%> -<% @Import Namespace="EnterpriseDB.EDBClient" %> -<% @Import Namespace="System.Data" %> -<% @Import Namespace="System.Configuration" %> - -``` - -Save the sample code in a file named `storedProc.aspx` in a web root directory. - -To invoke the sample code, enter the following in a browser: `http://localhost/storedProc.aspx` - -## Example: Executing a stored procedure with IN parameters - -This example calls a stored procedure that includes `IN` parameters. To create the sample procedure, invoke EDB-PSQL and connect to the EDB Postgres Advanced Server host database. Enter the following SPL code at the command line: - -```sql -CREATE OR REPLACE PROCEDURE - EMP_INSERT - ( - pENAME IN VARCHAR, - pJOB IN VARCHAR, - pSAL IN FLOAT4, - pCOMM IN FLOAT4, - pDEPTNO IN INTEGER, - pMgr IN INTEGER - ) -AS -DECLARE - CURSOR TESTCUR IS SELECT MAX(EMPNO) FROM EMP; - MAX_EMPNO INTEGER := 10; -BEGIN - - OPEN TESTCUR; - FETCH TESTCUR INTO MAX_EMPNO; - INSERT INTO EMP(EMPNO,ENAME,JOB,SAL,COMM,DEPTNO,MGR) - VALUES(MAX_EMPNO+1,pENAME,pJOB,pSAL,pCOMM,pDEPTNO,pMgr); - CLOSE testcur; -END; - -``` - -When EDB Postgres Advanced Server validates the stored procedure, it echoes `CREATE PROCEDURE`. - -### Passing input values to a stored procedure - -Calling a stored procedure that contains parameters is similar to executing a stored procedure without parameters. The major difference is that, when calling a parameterized stored procedure, you must use the `EDBParameter` collection of the `EDBCommand` object. When the `EDBParameter` is added to the `EDBCommand` collection, properties such as `ParameterName`, `DbType`, `Direction`, `Size`, and `Value` are set. - -This example shows the process of executing a parameterized stored procedure from a C# script: - -```cpp -<% @ Page Language="C#" Debug="true"%> -<% @Import Namespace="EnterpriseDB.EDBClient" %> -<% @Import Namespace="System.Data" %> -<% @Import Namespace="System.Configuration" %> - -``` - -Save the sample code in a file named `storedProcInParam.aspx` in a web root directory. - -To invoke the sample code, enter the following in a browser: `http://localhost/storedProcInParam.aspx` - -In the example, the body of the `Page_Load` method declares and instantiates an `EDBConnection` object. The sample then creates an `EDBCommand` object with the properties needed to execute the stored procedure. - -The example then uses the `Add` method of the `EDBCommand Parameter` collection to add six input parameters. - -```cpp -EDBCommand cmdStoredProc = new EDBCommand -("emp_insert(:EmpName,:Job,:Salary,:Commission,:DeptNo,:Manager)",conn); -cmdStoredProc.CommandType = CommandType.StoredProcedure; -``` - -It assigns a value to each parameter before passing them to the `EMP_INSERT` stored procedure. - -The `Prepare()` method prepares the statement before calling the `ExecuteNonQuery()` method. - -The `ExecuteNonQuery` method of the `EDBCommand` object executes the stored procedure. After the stored procedure executes, a test record is inserted into the `emp` table, and the values inserted are displayed on the web page. - -## Example: Executing a stored procedure with IN, OUT, and INOUT parameters - -The previous example showed how to pass `IN` parameters to a stored procedure. The following examples show how to pass `IN` values and return `OUT` values from a stored procedure. - -### Creating the stored procedure - -The following stored procedure passes the department number and returns the corresponding location and department name. To create the sample procedure, invoke EDB-PSQL and connect to the EDB Postgres Advanced Server host database. Enter the following SPL code at the command line: - -```sql -CREATE OR REPLACE PROCEDURE - DEPT_SELECT - ( - pDEPTNO IN INTEGER, - pDNAME OUT VARCHAR, - pLOC OUT VARCHAR - ) -AS -DECLARE - CURSOR TESTCUR IS SELECT DNAME,LOC FROM DEPT; - REC RECORD; -BEGIN - - OPEN TESTCUR; - FETCH TESTCUR INTO REC; - - pDNAME := REC.DNAME; - pLOC := REC.LOC; - - CLOSE testcur; -END; -``` - -When EDB Postgres Advanced Server validates the stored procedure, it echoes `CREATE PROCEDURE`. - -### Receiving output values from a stored procedure - -When retrieving values from `OUT` parameters, you must explicitly specify the direction of those parameters as `Output`. You can retrieve the values from `Output` parameters in two ways: - -- Call the `ExecuteReader` method of the `EDBCommand` and explicitly loop through the returned `EDBDataReader`, searching for the values of `OUT` parameters. -- Call the `ExecuteNonQuery` method of `EDBCommand` and explicitly get the value of a declared `Output` parameter by calling that `EDBParameter` value property. - -In each method, you must declare each parameter, indicating the direction of the parameter (`ParameterDirection.Input`, `ParameterDirection.Output`, or `ParameterDirection.InputOutput`). Before invoking the procedure, you must provide a value for each `IN` and `INOUT` parameter. After the procedure returns, you can retrieve the `OUT` and `INOUT` parameter values from the `command.Parameters[]` array. - -This code shows using the `ExecuteReader` method to retrieve a result set: - -```cpp -<% @ Page Language="C#" Debug="true"%> -<% @Import Namespace="EnterpriseDB.EDBClient" %> -<% @Import Namespace="System.Data" %> -<% @Import Namespace="System.Configuration" %> - -``` - -This code shows using the `ExecuteNonQuery` method to retrieve a result set: - -```cpp -<% @ Page Language="C#" Debug="true"%> -<% @Import Namespace="EnterpriseDB.EDBClient" %> -<% @Import Namespace="System.Data" %> -<% @Import Namespace="System.Configuration" %> - -``` diff --git a/product_docs/docs/net_connector/8.0.2.1/12_using_advanced_queueing.mdx b/product_docs/docs/net_connector/8.0.2.1/12_using_advanced_queueing.mdx deleted file mode 100644 index 0be613c3955..00000000000 --- a/product_docs/docs/net_connector/8.0.2.1/12_using_advanced_queueing.mdx +++ /dev/null @@ -1,492 +0,0 @@ ---- -title: "Using advanced queueing" - ---- - - - -EDB Postgres Advanced Server advanced queueing provides message queueing and message processing for the EDB Postgres Advanced Server database. User-defined messages are stored in a queue. A collection of queues is stored in a queue table. Create a queue table before creating a queue that depends on it. - -On the server side, procedures in the `DBMS_AQADM` package create and manage message queues and queue tables. Use the `DBMS_AQ` package to add messages to or remove messages from a queue or register or unregister a PL/SQL callback procedure. For more information about `DBMS_AQ` and `DBMS_AQADM`, see [DBMS_AQ](/epas/latest/reference/oracle_compatibility_reference/epas_compat_bip_guide/03_built-in_packages/02_dbms_aq/). - -On the client side, the application uses the EDB.NET driver to enqueue and dequeue messages. - -## Enqueueing or dequeueing a message - -For more information about using EDB Postgres Advanced Server's advanced queueing functionality, see [Built-in packages](/epas/latest/reference/oracle_compatibility_reference/epas_compat_bip_guide/). - -### Server-side setup - -To use advanced queueing functionality on your .NET application, you must first create a user-defined type, queue table, and queue, and then start the queue on the database server. Invoke EDB-PSQL and connect to the EDB Postgres Advanced Server host database. Use the following SPL commands at the command line. - -#### Creating a user-defined type - -To specify a RAW data type, create a user-defined type. This example shows creating a user-defined type named `myxml`: - -``` -CREATE TYPE myxml AS (value XML); -``` - -#### Creating the queue table - -A queue table can hold multiple queues with the same payload type. This example shows creating a table named `MSG_QUEUE_TABLE`: - -```Text -EXEC DBMS_AQADM.CREATE_QUEUE_TABLE - (queue_table => 'MSG_QUEUE_TABLE', - queue_payload_type => 'myxml', - comment => 'Message queue table'); -END; -``` - -#### Creating the queue - -This example shows creating a queue named `MSG_QUEUE` in the table `MSG_QUEUE_TABLE`: - -```Text -BEGIN -DBMS_AQADM.CREATE_QUEUE ( queue_name => 'MSG_QUEUE', queue_table => 'MSG_QUEUE_TABLE', comment => 'This queue contains pending messages.'); -END; -``` - -**Starting the queue** - -Once the queue is created, invoke the following SPL code at the command line to start a queue in the EDB database: - -```Text -BEGIN -DBMS_AQADM.START_QUEUE -(queue_name => 'MSG_QUEUE'); -END; -``` - -### Client-side example - -Once you've created a user-defined type, the queue table, and the queue, start the queue. Then, you can enqueue or dequeue a message using EDB .Net drivers. - -#### Enqueue a message - -To enqueue a message on your .NET application, you must: - -1. Import the `EnterpriseDB.EDBClient` namespace. -2. Pass the name of the queue and create the instance of the `EDBAQQueue`. -3. Create the enqueue message and define a payload. -4. Call the `queue.Enqueue` method. - -The following code shows using the `queue.Enqueue` method. - -!!! Note - This code creates the message and serializes it. This is example code and doesn't compile if copied as it is. You must serialize the message as XML. - -```Text -using EnterpriseDB.EDBClient; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace AQXml -{ - class MyXML - { - public string value { get; set; } - } - class Program - { - static void Main(string[] args) - { - int messagesToSend = 1; - if (args.Length > 0 && !string.IsNullOrEmpty(args[0])) - { - messagesToSend = int.Parse(args[0]); - } - for (int i = 0; i < 5; i++) - { - EnqueMsg("test message: " + i); - } - } - - private static EDBConnection GetConnection() - { - string connectionString = "Server=127.0.0.1;Host=127.0.0.1;Port=5444;User Id=enterprisedb;Password=test;Database=edb;Timeout=999"; - EDBConnection connection = new EDBConnection(connectionString); - connection.Open(); - return connection; - } - - - private static string ByteArrayToString(byte[] byteArray) - { - // Sanity check if it's null so we don't incur overhead of an exception - if (byteArray == null) - { - return string.Empty; - } - try - { - StringBuilder hex = new StringBuilder(byteArray.Length * 2); - foreach (byte b in byteArray) - { - hex.AppendFormat("{0:x2}", b); - } - - return hex.ToString().ToUpper(); - } - catch - { - return string.Empty; - } - } - - private static bool EnqueMsg(string msg) - { - EDBConnection con = GetConnection(); - using (EDBAQQueue queue = new EDBAQQueue("MSG_QUEUE", con)) - { - queue.MessageType = EDBAQMessageType.Xml; - EDBTransaction txn = queue.Connection.BeginTransaction(); - QueuedEntities.Message queuedMessage = new QueuedEntities.Message() { MessageText = msg }; - - try - { - string rootElementName = queuedMessage.GetType().Name; - if (rootElementName.IndexOf(".") != -1) - { - rootElementName = rootElementName.Split('.').Last(); - } - - string xml = new Utils.XmlFragmentSerializer().Serialize(queuedMessage); - EDBAQMessage queMsg = new EDBAQMessage(); - queMsg.Payload = new MyXML { value = xml }; - queue.MessageType = EDBAQMessageType.Udt; - queue.UdtTypeName = "myxml"; - EDBConnection.GlobalTypeMapper.MapComposite("myxml"); - con.ReloadTypes(); - queue.Enqueue(queMsg); - var messageId = ByteArrayToString((byte[])queMsg.MessageId); - Console.WriteLine("MessageID: " + messageId); - txn.Commit(); - queMsg = null; - xml = null; - rootElementName = null; - return true; - } - catch (Exception ex) - { - txn?.Rollback(); - Console.WriteLine("Failed to enqueue message."); - Console.WriteLine(ex.ToString()); - return false; - } - finally - { - queue?.Connection?.Dispose(); - } - } - } - - } -} -``` - -#### Dequeueing a message - -To dequeue a message on your .NET application, you must: - -1. Import the `EnterpriseDB.EDBClient` namespace. -2. Pass the name of the queue and create the instance of the `EDBAQQueue`. -3. Call the `queue.Dequeue` method. - -!!! Note - The following code creates the message and serializes it. This is example code and doesn't compile if copied as it is. You must serialize the message as XML. - -```Text -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using EnterpriseDB.EDBClient; - -namespace DequeueXML -{ - class MyXML - { - public string value { get; set; } - } - class Program - { - static void Main(string[] args) - { - DequeMsg(); - } - - - private static EDBConnection GetConnection() - { - string connectionString = "Server=127.0.0.1;Host=127.0.0.1;Port=5444;User Id=enterprisedb;Password=test;Database=edb;Timeout=999"; - EDBConnection connection = new EDBConnection(connectionString); - connection.Open(); - return connection; - } - - - private static string ByteArrayToString(byte[] byteArray) - { - // Sanity check if it's null so we don't incur overhead of an exception - if (byteArray == null) - { - return string.Empty; - } - try - { - StringBuilder hex = new StringBuilder(byteArray.Length * 2); - foreach (byte b in byteArray) - { - hex.AppendFormat("{0:x2}", b); - } - - return hex.ToString().ToUpper(); - } - catch - { - return string.Empty; - } - } - public static void DequeMsg(int waitTime = 10) - { - EDBConnection con = GetConnection(); - using (EDBAQQueue queueListen = new EDBAQQueue("MSG_QUEUE", con)) - { - queueListen.UdtTypeName = "myxml"; - queueListen.DequeueOptions.Navigation = EDBAQNavigationMode.FIRST_MESSAGE; - queueListen.DequeueOptions.Visibility = EDBAQVisibility.ON_COMMIT; - queueListen.DequeueOptions.Wait = 1; - EDBTransaction txn = null; - - while (1 == 1) - { - - if (queueListen.Connection.State == System.Data.ConnectionState.Closed) - { - queueListen.Connection.Open(); - } - - string messageId = "Unknown"; - try - { - // the listen function is a blocking function. It will Wait the specified waitTime or until a - // message is received. - Console.WriteLine("Listening..."); - string v = queueListen.Listen(null, waitTime); - // If we are waiting for a message and we specify a Wait time, - // then if there are no more messages, we want to just bounce out. - if (waitTime > -1 && v == null) - { - Console.WriteLine("No message received during Wait period."); - Console.WriteLine(); - continue; - } - - // once we're here that means a message has been detected in the queue. Let's deal with it. - txn = queueListen.Connection.BeginTransaction(); - - Console.WriteLine("Attempting to dequeue message..."); - // dequeue the message - EDBAQMessage deqMsg; - try - { - deqMsg = queueListen.Dequeue(); - } - catch (Exception ex) - { - if (ex.Message.Contains("ORA-25228")) - { - Console.WriteLine("Message was not there. Another process must have picked it up."); - Console.WriteLine(); - txn.Rollback(); - continue; - } - else - { - throw; - } - } - - messageId = ByteArrayToString((byte[])deqMsg.MessageId); - if (deqMsg != null) - { - Console.WriteLine("Processing received message..."); - // process the message payload - MyXML obj = (MyXML) deqMsg.Payload; - - QueuedEntities.Message msg = new Utils.XmlFragmentSerializer().Deserialize(obj.value); - - Console.WriteLine("Received Message:"); - Console.WriteLine("MessageID: " + messageId); - Console.WriteLine("Message: " + msg.MessageText); - Console.WriteLine("Enqueue Time" + queueListen.MessageProperties.EnqueueTime); - - txn.Commit(); - - Console.WriteLine("Finished processing message"); - Console.WriteLine(); - - } - else - { - Console.WriteLine("Message was not dequeued."); - } - } - catch (Exception ex) - { - Console.WriteLine("Failed To dequeue or process the dequeued message."); - Console.WriteLine(ex.ToString()); - Console.WriteLine(); - if (txn != null) - { - txn.Rollback(); - if (txn != null) - { - txn.Dispose(); - } - } - } - } - } - - } - } -} -``` - -## EDBAQ classes - -The following EDBAQ classes are used in this application. - -### EDBAQDequeueMode - -The `EDBAQDequeueMode` class lists all the dequeuer modes available. - -| Value | Description | -| ------------- | ------------------------------------------------------------- | -| Browse | Reads the message without locking. | -| Locked | Reads and gets a write lock on the message. | -| Remove | Deletes the message after reading. This is the default value. | -| Remove_NoData | Confirms receipt of the message. | - -### EDBAQDequeueOptions - -The `EDBAQDequeueOptions` class lists the options available when dequeuing a message. - -| Property | Description | -| -------------- | ------------------------------------------------------------------------------------------------------------------------------ | -| ConsumerName | The name of the consumer for which to dequeue the message. | -| DequeueMode | Set from `EDBAQDequeueMode`. It represents the locking behavior linked with the dequeue option. | -| Navigation | Set from `EDBAQNavigationMode`. It represents the position of the message to fetch. | -| Visibility | Set from `EDBAQVisibility`. It represents whether the new message is dequeued as part of the current transaction. | -| Wait | The wait time for a message as per the search criteria. | -| Msgid | The message identifier. | -| Correlation | The correlation identifier. | -| DeqCondition | The dequeuer condition. It's a Boolean expression. | -| Transformation | The transformation to apply before dequeuing the message. | -| DeliveryMode | The delivery mode of the dequeued message. | - -### EDBAQEnqueueOptions - -The `EDBAQEnqueueOptions` class lists the options available when enqueuing a message. - -| Property | Description | -| ----------------- | ------------------------------------------------------------------------------------------------------------------------------ | -| Visibility | Set from `EDBAQVisibility`. It represents whether the new message is enqueued as part of the current transaction. | -| RelativeMsgid | The relative message identifier. | -| SequenceDeviation | The sequence when to dequeue the message. | -| Transformation | The transformation to apply before enqueuing the message. | -| DeliveryMode | The delivery mode of the enqueued message. | - -### EDBAQMessage - -The `EDBAQMessage` class lists a message to enqueue/dequeue. - -| Property | Description | -| ------------ | -------------------------------- | -| Payload | The actual message to queue. | -| MessageId | The ID of the queued message. | - -### EDBAQMessageProperties - -The `EDBAQMessageProperties` lists the message properties available. - -| Property | Description | -| ---------------- | --------------------------------------------------------------------------------------------- | -| Priority | The priority of the message. | -| Delay | The duration after which the message is available for dequeuing, in seconds. | -| Expiration | The duration for which the message is available for dequeuing, in seconds. | -| Correlation | The correlation identifier. | -| Attempts | The number of attempts taken to dequeue the message. | -| RecipientList | The recipients list that overthrows the default queue subscribers. | -| ExceptionQueue | The name of the queue to move the unprocessed messages to. | -| EnqueueTime | The time when the message was enqueued. | -| State | The state of the message while dequeued. | -| OriginalMsgid | The message identifier in the last queue. | -| TransactionGroup | The transaction group for the dequeued messages. | -| DeliveryMode | The delivery mode of the dequeued message. | - -### EDBAQMessageState - -The `EDBAQMessageState` class represents the state of the message during dequeue. - -| Value | Description | -| --------- | --------------------------------------------------------- | -| Expired | The message is moved to the exception queue. | -| Processed | The message is processed and kept. | -| Ready | The message is ready to be processed. | -| Waiting | The message is in waiting state. The delay isn't reached. | - -### EDBAQMessageType - -The `EDBAQMessageType` class represents the types for payload. - -| Value | Description | -| --------- | ------------------------------------------------------------------------------------- | -| Raw | The raw message type.

Note: Currently, this payload type isn't supported. | -| UDT | The user-defined type message. | -| XML | The XML type message.

Note: Currently, this payload type isn't supported. | - -### EDBAQNavigationMode - -The `EDBAQNavigationMode` class represents the different types of navigation modes available. - -| Value | Description | -| ---------------- | ------------------------------------------------------------------ | -| First_Message | Returns the first available message that matches the search terms. | -| Next_Message | Returns the next available message that matches the search items. | -| Next_Transaction | Returns the first message of next transaction group. | - -### EDBAQQueue - -The `EDBAQQueue` class represents a SQL statement to execute `DMBS_AQ` functionality on a PostgreSQL database. - -| Property | Description | -| ----------------- | --------------------------------------------------------------------------------------------- | -| Connection | The connection to use. | -| Name | The name of the queue. | -| MessageType | The message type that's enqueued/dequeued from this queue, for example `EDBAQMessageType.Udt`. | -| UdtTypeName | The user-defined type name of the message type. | -| EnqueueOptions | The enqueue options to use. | -| DequeuOptions | The dequeue options to use. | -| MessageProperties | The message properties to use. | - -### EDBAQVisibility - -The `EDBAQVisibility` class represents the visibility options available. - -| Value | Description | -| --------- | ----------------------------------------------------------- | -| Immediate | The enqueue/dequeue isn't part of the ongoing transaction. | -| On_Commit | The enqueue/dequeue is part of the current transaction. | - -!!! Note - - To review the default options for these parameters, see [DBMS_AQ](../../epas/11/epas_compat_bip_guide/03_built-in_packages/02_dbms_aq/). - - EDB advanced queueing functionality uses user-defined types for calling enqueue/dequeue operations. `Server Compatibility Mode=NoTypeLoading` can't be used with advanced queueing because `NoTypeLoading` doesn't load any user-defined types. diff --git a/product_docs/docs/net_connector/8.0.2.1/13_using_a_ref_cursor_in_a_net_application.mdx b/product_docs/docs/net_connector/8.0.2.1/13_using_a_ref_cursor_in_a_net_application.mdx deleted file mode 100644 index eee3876bfab..00000000000 --- a/product_docs/docs/net_connector/8.0.2.1/13_using_a_ref_cursor_in_a_net_application.mdx +++ /dev/null @@ -1,104 +0,0 @@ ---- -title: "Using a ref cursor in a .NET application" - ---- - - - -A `ref cursor` is a cursor variable that contains a pointer to a query result set. The result set is determined by executing the `OPEN FOR` statement using the cursor variable. A cursor variable isn't tied to a particular query like a static cursor. You can open the same cursor variable a number of times with the `OPEN FOR` statement containing different queries each time. A new result set is created for that query and made available by way of the cursor variable. You can declare a cursor variable in two ways: - -- Use the `SYS_REFCURSOR` built-in data type to declare a weakly typed ref cursor. -- Define a strongly typed ref cursor that declares a variable of that type. - -`SYS_REFCURSOR` is a ref cursor type that allows any result set to be associated with it. This is known as a weakly typed ref cursor. The following example is a declaration of a weakly typed ref cursor: - -``` - name SYS_REFCURSOR`; -``` - -Following is an example of a strongly typed ref cursor: - -``` -TYPE IS REF CURSOR RETURN emp%ROWTYPE`; -``` - -## Creating the stored procedure - -This sample code creates a stored procedure called `refcur_inout_callee`. It specifies the data type of the ref cursor being passed as an OUT parameter. To create the sample procedure, invoke EDB-PSQL and connect to the EDB Postgres Advanced Server host database. Enter the following SPL code at the command line: - -```sql -CREATE OR REPLACE PROCEDURE - refcur_inout_callee(v_refcur OUT SYS_REFCURSOR) -IS -BEGIN - OPEN v_refcur FOR SELECT ename FROM emp; -END; -``` - -This C# code uses the stored procedure to retrieve employee names from the `emp` table: - -```cpp -using System; -using System.Data; -using EnterpriseDB.EDBClient; -using System.Configuration; -namespace EDBRefCursor -{ - class EmpRefcursor - { - [STAThread] - static void Main(string[] args) - { - var strConnectionString = - ConfigurationManager.AppSettings["DB_CONN_STRING"]; - try - { - await using var dataSource = EDBDataSource.Create(ConnectionString); - var conn = await dataSource.OpenConnectionAsync(); - await using var tran = await connection.BeginTransactionAsync(); - using var command = new EDBCommand("refcur_inout_callee", conn); - command.CommandType = CommandType.StoredProcedure; - command.Transaction = tran; - command.Parameters.Add(new EDBParameter("refCursor", - EDBTypes.EDBDbType.Refcursor, 10, "refCursor", - ParameterDirection.Output, false, 2, 2, - System.Data.DataRowVersion.Current, null)); - await command.PrepareAsync(); - command.Parameters[0].Value = null; - await command.ExecuteNonQueryAsync(); - var cursorName = command.Parameters[0].Value.ToString(); - command.CommandText = "fetch all in \"" + cursorName + "\""; - command.CommandType = CommandType.Text; - await using var reader = - await command.ExecuteReaderAsync(CommandBehavior.SequentialAccess); - var fc = reader.FieldCount; - while (await reader.ReadAsync()) - { - for (int i = 0; i < fc; i++) - { - Console.WriteLine(reader.GetString(i)); - } - } - await reader.CloseAsync(); - await tran.CommitAsync(); - await conn.CloseAsync(); - } - catch (Exception ex) - { - Console.WriteLine(ex.Message.ToString()); - } - } - } -} -``` - -This .NET code snippet displays the result on the console: - -```cpp -for(int i = 0;i < fc; i++) -{ - Console.WriteLine(reader.GetString(i)); -} -``` - -You must bind the `EDBDbType.RefCursor` type in `EDBParameter()` if you're using a ref cursor parameter. diff --git a/product_docs/docs/net_connector/8.0.2.1/14_using_plugins.mdx b/product_docs/docs/net_connector/8.0.2.1/14_using_plugins.mdx deleted file mode 100644 index 9e8a3b1389e..00000000000 --- a/product_docs/docs/net_connector/8.0.2.1/14_using_plugins.mdx +++ /dev/null @@ -1,72 +0,0 @@ ---- -title: "Using plugins" - ---- - - - -EDB .Net driver plugins support the enhanced capabilities for different data types that are otherwise not available in .Net. The different plugins available support: - -- GeoJSON -- Json.NET -- NetTopologySuite -- NodaTime - -The plugins support the use of spatial, data/time, and JSON types. The following are the supported frameworks and data provider installation path for these plugins. - -## GeoJSON - -If you're using the GeoJSON plugin on .NET Standard 2.0, the data provider installation paths are: - -- `C:\Program Files\edb\dotnet\plugins\GeoJSON\netstandard2.0` -- `C:\Program Files\edb\dotnet\plugins\GeoJSON\net472` -- `C:\Program Files\edb\dotnet\plugins\GeoJSON\net48` -- `C:\Program Files\edb\dotnet\plugins\GeoJSON\net481` - -The following shared library files are required: - -- `EnterpriseDB.EDBClient.GeoJSON.dll` - -For detailed information about using the GeoJSON plugin, see the [Npgsql documentation](http://www.npgsql.org/doc/types/geojson.html). - -## Json.NET - -If you're using the Json.NET plugin on .NET Standard 2.0, the data provider installation paths are: -- `C:\Program Files\edb\dotnet\plugins\Json.NET\netstandard2.0` -- `C:\Program Files\edb\dotnet\plugins\Json.NET\net472` -- `C:\Program Files\edb\dotnet\plugins\Json.NET\net48` -- `C:\Program Files\edb\dotnet\plugins\Json.NET\net481` - -The following shared library files are required: - -- `EnterpriseDB.EDBClient.Json.NET.dll` - -For detailed information about using the Json.NET plugin, see the [Npgsql documentation](http://www.npgsql.org/doc/types/jsonnet.html). - -## NetTopologySuite - -If you're using the NetTopologySuite plugin on .Net Standard 2.0, the data provider installation paths are: -- `C:\Program Files\edb\dotnet\plugins\NetTopologySuite\netstandard2.0` -- `C:\Program Files\edb\dotnet\plugins\NetTopologySuite\net472` -- `C:\Program Files\edb\dotnet\plugins\NetTopologySuite\net48` -- `C:\Program Files\edb\dotnet\plugins\NetTopologySuite\net481` - -The following shared library files are required: - -- `EnterpriseDB.EDBClient.NetTopologySuite.dll` - -For detailed information about using the NetTopologySuite type plugin, see the [Npgsql documentation](http://www.npgsql.org/doc/types/nts.html). - -## NodaTime - -If you're using the NodaTime plugin on .Net Standard 2.0, the data provider installation paths are: -- `C:\Program Files\edb\dotnet\plugins\NodaTime\netstandard2.0` -- `C:\Program Files\edb\dotnet\plugins\NodaTime\net472` -- `C:\Program Files\edb\dotnet\plugins\NodaTime\net48` -- `C:\Program Files\edb\dotnet\plugins\NodaTime\net481` - -The following shared library files are required: - -- `EnterpriseDB.EDBClient.NodaTime.dll` - -For detailed information about using the NodaTime plugin, see the [Npgsql documentation](http://www.npgsql.org/doc/types/nodatime.html). diff --git a/product_docs/docs/net_connector/8.0.2.1/15_using_object_types.mdx b/product_docs/docs/net_connector/8.0.2.1/15_using_object_types.mdx deleted file mode 100644 index c57c5ba4713..00000000000 --- a/product_docs/docs/net_connector/8.0.2.1/15_using_object_types.mdx +++ /dev/null @@ -1,181 +0,0 @@ ---- -title: "Using object types in .NET" - ---- - - - -The SQL `CREATE TYPE` command creates a user-defined object type, which is stored in the EDB Postgres Advanced Server database. You can then reference these user-defined types in SPL procedures, SPL functions, and .NET programs. - -Create the basic object type with the `CREATE TYPE AS OBJECT` command. Optionally, use the `CREATE TYPE BODY` command. - -## Using an object type - -To use an object type, you must first create the object type in the EDB Postgres Advanced Server database. Object type `addr_object_type` defines the attributes of an address: - -```text -CREATE OR REPLACE TYPE addr_object_type AS OBJECT -( - street VARCHAR2(30), - city VARCHAR2(20), - state CHAR(2), - zip NUMBER(5) -); -``` - -Object type `emp_obj_typ` defines the attributes of an employee. One of these attributes is object type `ADDR_OBJECT_TYPE`, as previously described. The object type body contains a method that displays the employee information: - -```text -CREATE OR REPLACE TYPE emp_obj_typ AS OBJECT -( - empno NUMBER(4), - ename VARCHAR2(20), - addr ADDR_OBJECT_TYPE, - MEMBER PROCEDURE display_emp(SELF IN OUT emp_obj_typ) -); - -CREATE OR REPLACE TYPE BODY emp_obj_typ AS - MEMBER PROCEDURE display_emp (SELF IN OUT emp_obj_typ) - IS - BEGIN - DBMS_OUTPUT.PUT_LINE('Employee No : ' || SELF.empno); - DBMS_OUTPUT.PUT_LINE('Name : ' || SELF.ename); - DBMS_OUTPUT.PUT_LINE('Street : ' || SELF.addr.street); - DBMS_OUTPUT.PUT_LINE('City/State/Zip: ' || SELF.addr.city || ', ' || - SELF.addr.state || ' ' || LPAD(SELF.addr.zip,5,'0')); - END; -END; -``` - -This example is a complete .NET program that uses these user-defined object types: - -```text -using EnterpriseDB.EDBClient; -using System.Data.Common; -namespace TypesTest -{ - internal class Program - { - static async Task Main(string[] args) - { - var connString = "Server=localhost;Port=5444;database=edb;User ID=enterprisedb;password=edb;"; - var dataSourceBuilder = new EDBDataSourceBuilder(connString); - dataSourceBuilder.MapComposite("enterprisedb.addr_object_type"); - dataSourceBuilder.MapComposite("enterprisedb.emp_obj_typ"); - await using var dataSource = dataSourceBuilder.Build(); - await using var conn = await dataSource.OpenConnectionAsync(); - try - { - var address = new addr_object_type() - { - street = "123 MAIN STREET", - city = "EDISON", - state = "NJ", - zip = 8817 - }; - var emp = new emp_obj_typ() - { - empno = 9001, - ename = "JONES", - addr = address - }; - await using (var cmd = new EDBCommand("emp_obj_typ.display_emp", conn)) - { - cmd.CommandType = System.Data.CommandType.StoredProcedure; - EDBCommandBuilder.DeriveParameters(cmd); - cmd.Parameters[0].Value = emp; - cmd.Prepare(); - cmd.ExecuteNonQuery(); - var empOut = (emp_obj_typ?)cmd.Parameters[0].Value; - Console.WriteLine("Emp No: " + empOut.empno); - Console.WriteLine("Emp Name: " + empOut.ename); - Console.WriteLine("Emp Address Street: " + empOut.addr.street); - Console.WriteLine("Emp Address City: " + empOut.addr.city); - Console.WriteLine("Emp Address State: " + empOut.addr.state); - Console.WriteLine("Emp Address Zip: " + empOut.addr.zip); - Console.WriteLine("Emp No: " + empOut.empno); - } - } - catch (EDBException exp) - { - Console.WriteLine(exp.Message.ToString()); - } - finally - { - conn.Close(); - } - } - } -public class addr_object_type - { - public string? street; - public string? city; - public string? state; - public decimal zip; - } - public class emp_obj_typ - { - public decimal empno; - public string? ename; - public addr_object_type? addr; - } -} -``` - -The following .NET types are defined to map to the types in EDB Postgres Advanced Server: - -```text -public class addr_object_type -{ -public string? street; -public string? city; -public string? state; -public decimal zip; -} - -public class emp_obj_typ -{ - public decimal empno; - public string? ename; - public addr_object_type? addr; -} -``` - -A call to `EDBDataSourceBuilder.MapComposite` maps the .NET type to the EDB Postgres Advanced Server types: - -```text -dataSourceBuilder.MapComposite("enterprisedb.addr_object_type"); -dataSourceBuilder.MapComposite("enterprisedb.emp_obj_typ"); -``` - -A call to `EDBCommandBuilder.DeriveParameters()` gets parameter information for a stored procedure. This allows you to just set the parameter values and call the stored procedure: - -```text -EDBCommandBuilder.DeriveParameters(cmd); -``` - -Set the value of the parameter by creating an object of the .NET type and assigning it to the `Value` property of the parameter: - -```text -addr_object_type address = new addr_object_type() -{ - street = "123 MAIN STREET", - city = "EDISON", - state = "NJ", - zip = 8817 -}; - -emp_obj_typ emp = new emp_obj_typ() -{ - empno = 9001, - ename = "JONES", - addr = address -}; -cmd.Parameters[0].Value = emp; -``` - -A call to `cmd.ExecuteNonQuery()` executes the call to the `display_emp()` method: - -```text -cmd.ExecuteNonQuery(); -``` diff --git a/product_docs/docs/net_connector/8.0.2.1/16_scram_compatibility.mdx b/product_docs/docs/net_connector/8.0.2.1/16_scram_compatibility.mdx deleted file mode 100644 index 96388c7a6b6..00000000000 --- a/product_docs/docs/net_connector/8.0.2.1/16_scram_compatibility.mdx +++ /dev/null @@ -1,10 +0,0 @@ ---- -title: "Scram compatibility" -legacyRedirects: - - "/edb-docs/d/edb-postgres-net-connector/user-guides/net-guide/4.1.6.1/security_and_encryption.html" - ---- - - - -The EDB .NET driver provides SCRAM-SHA-256 support for EDB Postgres Advanced Server version 10 and later. This support is available in EDB .NET 4.0.2.1 release and later. diff --git a/product_docs/docs/net_connector/8.0.2.1/17_advanced_server_net_connector_logging.mdx b/product_docs/docs/net_connector/8.0.2.1/17_advanced_server_net_connector_logging.mdx deleted file mode 100644 index d9155770283..00000000000 --- a/product_docs/docs/net_connector/8.0.2.1/17_advanced_server_net_connector_logging.mdx +++ /dev/null @@ -1,82 +0,0 @@ ---- -title: "EDB .NET Connector logging" - ---- - - - -EDB .NET Connector supports the use of logging to help resolve issues with the .NET Connector when used in your application. EDB .NET Connector supports logging using the standard .NET `Microsoft.Extensions.Logging` package. For more information about logging in .Net, see [Logging in C# and .NET](https://learn.microsoft.com/en-us/dotnet/core/extensions/logging?tabs=command-line) in the Microsoft documentation. - -!!! Note - For versions earlier than 7.x, EDB .NET Connector had its own, custom logging API. - -## Console logging provider - -The .NET logging API works with a variety of built-in and third-party logging providers. The console logging provider logs output to the console. - -### Console logging with EDBDataSource - -Create a `Microsoft.Extensions.Logging.LoggerFactory` and configure an `EDBDataSource` with it. Any use of connections opened through this data source log using this logger factory. - -```text -var loggerFactory = LoggerFactory.Create(builder => builder.AddSimpleConsole()); - -var dataSourceBuilder = new EDBDataSourceBuilder(connectionString); -dataSourceBuilder.UseLoggerFactory(loggerFactory); -await using var dataSource = dataSourceBuilder.Build(); - -await using var connection = await dataSource.OpenConnectionAsync(); -await using var command = new EDBCommand("SELECT 1", connection); -_ = await command.ExecuteScalarAsync(); -``` - -### Console logging without EDBDataSource - -Create a `Microsoft.Extensions.Logging.LoggerFactory` and configure EDB .NET Connector's logger factory globally using `EDBLoggingConfiguration.InitializeLogging`. Configure it at the start of your program, before using any other EDB .NET Connector API. - -```text -var loggerFactory = LoggerFactory.Create(builder => builder.AddSimpleConsole()); -EDBLoggingConfiguration.InitializeLogging(loggerFactory); - -await using var conn = new EDBConnection(connectionString); -await conn.OpenAsync(); -await using var command = new EDBCommand("SELECT 1", conn); -_ = await command.ExecuteScalarAsync(); -``` - -## Log levels - -The following log levels are available: - -- Trace -- Debug -- Information -- Warning -- Error -- Fatal - -This example shows how to change the log level to `Trace`: - -```text -var loggerFactory = LoggerFactory.Create(builder => builder -.SetMinimumLevel(LogLevel.Trace -.AddSimpleConsole() -); -``` - -## Formatting the log output - -This example shows how to format your log output. Create a `LoggerFactory` to restrict each log message to a single line and add a date and time to the log: - -```text -var loggerFactory = LoggerFactory.Create(builder => -builder -.SetMinimumLevel(LogLevel.Trace) -.AddSimpleConsole( - options => - { - options.SingleLine = true; - options.TimestampFormat = "yyyy/MM/dd HH:mm:ss "; - } - )); -``` \ No newline at end of file diff --git a/product_docs/docs/net_connector/8.0.2.1/18_api_reference.mdx b/product_docs/docs/net_connector/8.0.2.1/18_api_reference.mdx deleted file mode 100644 index 53050c37952..00000000000 --- a/product_docs/docs/net_connector/8.0.2.1/18_api_reference.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -title: "API reference" - ---- - - - -For information about using the API, see the [Npgsql documentation](http://www.npgsql.org/doc/api/Npgsql.html). - -Usage notes: - -- When using the API, replace references to `Npgsql` with `EnterpriseDB.EDBClient`. -- When referring to classes, replace `Npgsql` with `EDB`. For example, use the `EDBBinaryExporter` class instead of the `NpgsqlBinaryExporter` class. diff --git a/product_docs/docs/net_connector/8.0.2.1/images/connection_opened_successfully.png b/product_docs/docs/net_connector/8.0.2.1/images/connection_opened_successfully.png deleted file mode 100755 index bab12126d20..00000000000 --- a/product_docs/docs/net_connector/8.0.2.1/images/connection_opened_successfully.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:537e7edecce3882b794110e0ffc644a51cab69ba2c7e7f82a3e99d32c4b4ba65 -size 22683 diff --git a/product_docs/docs/net_connector/8.0.2.1/images/dialog.png b/product_docs/docs/net_connector/8.0.2.1/images/dialog.png deleted file mode 100755 index 19cba54d1f9..00000000000 --- a/product_docs/docs/net_connector/8.0.2.1/images/dialog.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:f922e6cd4e43927708b5f460f5389a5b3a41dd70f3a5394723e6aee7d710f1ae -size 9048 diff --git a/product_docs/docs/net_connector/8.0.2.1/images/dotnet_installation_complete.png b/product_docs/docs/net_connector/8.0.2.1/images/dotnet_installation_complete.png deleted file mode 100755 index 332ae795899..00000000000 --- a/product_docs/docs/net_connector/8.0.2.1/images/dotnet_installation_complete.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:0983f216ce071f57f7e758980c3f966caded4312412905a6aba66efa362fdb13 -size 272137 diff --git a/product_docs/docs/net_connector/8.0.2.1/images/dotnet_installation_dialog.png b/product_docs/docs/net_connector/8.0.2.1/images/dotnet_installation_dialog.png deleted file mode 100755 index b465d536032..00000000000 --- a/product_docs/docs/net_connector/8.0.2.1/images/dotnet_installation_dialog.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:994a725f061f1b51fd92ccc2df5abd9066a1cf4ea7600611ae57ebc6cc59af20 -size 51144 diff --git a/product_docs/docs/net_connector/8.0.2.1/images/dotnet_installation_wizard.png b/product_docs/docs/net_connector/8.0.2.1/images/dotnet_installation_wizard.png deleted file mode 100755 index 29c9a7f99f9..00000000000 --- a/product_docs/docs/net_connector/8.0.2.1/images/dotnet_installation_wizard.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:efe8029105db01662005a349a7b59c87b6f7dce3017990a197e3b9b681392860 -size 227235 diff --git a/product_docs/docs/net_connector/8.0.2.1/images/ready_to_install.png b/product_docs/docs/net_connector/8.0.2.1/images/ready_to_install.png deleted file mode 100755 index 59e44d96bc5..00000000000 --- a/product_docs/docs/net_connector/8.0.2.1/images/ready_to_install.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:91b18bef7b78a6dae7d6b664e2bccfbfdb4248dbd034cb59e2c6a35ada7da49c -size 44080 diff --git a/product_docs/docs/net_connector/8.0.2.1/images/selecting_the_connectors_installer.png b/product_docs/docs/net_connector/8.0.2.1/images/selecting_the_connectors_installer.png deleted file mode 100755 index 432e4473c09..00000000000 --- a/product_docs/docs/net_connector/8.0.2.1/images/selecting_the_connectors_installer.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:d939c7e6604025f82be47969d69e6acc63ab5a48a0af4341e42efe0156b42778 -size 97808 diff --git a/product_docs/docs/net_connector/8.0.2.1/images/starting_stackbuilder_plus.png b/product_docs/docs/net_connector/8.0.2.1/images/starting_stackbuilder_plus.png deleted file mode 100755 index 11665300652..00000000000 --- a/product_docs/docs/net_connector/8.0.2.1/images/starting_stackbuilder_plus.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:ce6bcefb865ca14239fb7e0e2ac5149ed56251cfbc5153869070d039f70857c6 -size 91989 diff --git a/product_docs/docs/net_connector/8.0.2.1/index.mdx b/product_docs/docs/net_connector/8.0.2.1/index.mdx deleted file mode 100644 index 9080aaed7be..00000000000 --- a/product_docs/docs/net_connector/8.0.2.1/index.mdx +++ /dev/null @@ -1,20 +0,0 @@ ---- -title: "EDB .NET Connector" -directoryDefaults: - description: "EDB .NET Connector version 8.0.2.1 documentation and release notes." -pdf: true ---- - -The EDB .NET Connector distributed with EDB Postgres Advanced Server provides connectivity between a .NET client application and an EDB Postgres Advanced Server database server. You can: - -- Connect to an instance of EDB Postgres Advanced Server. -- Retrieve information from an EDB Postgres Advanced Server database. -- Update information stored on an EDB Postgres Advanced Server database. - -To understand these examples, you need a solid working knowledge of C# and .NET. The EDB .NET Connector functionality is built on the core functionality of the Npgsql open source project. For details, see the [Npgsql User Guide](http://www.npgsql.org/doc/index.html). - -
- -release_notes requirements_overview the_advanced_server_net_connector_overview installing_and_configuring_the_net_connector using_the_net_connector opening_a_database_connection retrieving_database_records parameterized_queries inserting_records_in_a_database deleting_records_in_a_database using_spl_stored_procedures_in_your_net_application using_advanced_queueing using_a_ref_cursor_in_a_net_application using_plugins using_object_types scram_compatibility advanced_server_net_connector_logging api_reference conclusion - -
diff --git a/product_docs/docs/net_connector/8.0.5.1/release_notes/4.0.10.1_rel_notes.mdx b/product_docs/docs/net_connector/8.0.5.1/release_notes/4.0.10.1_rel_notes.mdx new file mode 100644 index 00000000000..49fedecef8d --- /dev/null +++ b/product_docs/docs/net_connector/8.0.5.1/release_notes/4.0.10.1_rel_notes.mdx @@ -0,0 +1,13 @@ +--- +title: "Version 4.0.10.1" + +--- +The EDB .NET Connector provides connectivity between a .NET client application and an EDB Postgres Advanced Server database server. + +New features, enhancements, bug fixes, and other changes in the EDB .NET Connector `4.0.10.1` include: + +| Type | Description | +|----------------|-----------------------------------------------------------| +| Upstream merge | Merged with the upstream community driver version 4.0.10. | +| Enhancement | Added support for Windows Server 2019 platform. | +| Enhancement | Added support for VSIX for Visual Studio 2019. | diff --git a/product_docs/docs/net_connector/8.0.5.1/release_notes/4.0.10.2_rel_notes.mdx b/product_docs/docs/net_connector/8.0.5.1/release_notes/4.0.10.2_rel_notes.mdx new file mode 100644 index 00000000000..a46c116042c --- /dev/null +++ b/product_docs/docs/net_connector/8.0.5.1/release_notes/4.0.10.2_rel_notes.mdx @@ -0,0 +1,11 @@ +--- +title: "Version 4.0.10.2" + +--- +The EDB .NET Connector provides connectivity between a .NET client application and an EDB Postgres Advanced Server database server. + +New features, enhancements, bug fixes, and other changes in the EDB .NET Connector `4.0.10.2` include: + +| Type | Description | +|----------------|--------------------------------------------------------------------------------------------------------------------------------------------------------| +| Enhancement | Added connection parameter, `Load Role Based Tables`. | diff --git a/product_docs/docs/net_connector/8.0.5.1/release_notes/4.0.6.1_rel_notes.mdx b/product_docs/docs/net_connector/8.0.5.1/release_notes/4.0.6.1_rel_notes.mdx new file mode 100644 index 00000000000..9064cf6e608 --- /dev/null +++ b/product_docs/docs/net_connector/8.0.5.1/release_notes/4.0.6.1_rel_notes.mdx @@ -0,0 +1,13 @@ +--- +title: "Version 4.0.6.1" + +--- +The EDB .NET Connector provides connectivity between a .NET client application and an EDB Postgres Advanced Server database server. + +New features, enhancements, bug fixes, and other changes in the EDB .NET Connector `4.0.6.1` include: + +| Type | Description | +|----------------|-------------------------------------------------------------------------------------------------------------------------------------| +| Upstream merge | Merged with the upstream community driver version 4.0.6. | +| Enhancement | Added Advanced Queueing feature that provides message queueing and message processing support for the EDB Advanced Server database. | + diff --git a/product_docs/docs/net_connector/8.0.5.1/release_notes/4.1.3.1_rel_notes.mdx b/product_docs/docs/net_connector/8.0.5.1/release_notes/4.1.3.1_rel_notes.mdx new file mode 100644 index 00000000000..71aebc9fbbe --- /dev/null +++ b/product_docs/docs/net_connector/8.0.5.1/release_notes/4.1.3.1_rel_notes.mdx @@ -0,0 +1,12 @@ +--- +title: "Version 4.1.3.1" + +--- +The EDB .NET Connector provides connectivity between a .NET client application and an EDB Postgres Advanced Server database server. + +New features, enhancements, bug fixes, and other changes in the EDB .NET Connector `4.1.3.1` include: + +| Type | Description | +|----------------|--------------------------------------------------------------------------------------------------------------------------------------------------------| +| Upstream merge | Merged with the upstream Npgsql driver version 4.1.3. For more information about the merge updates, see . | +| Enhancement | Support for .NET Framework 4.6.1, .NET Core 3.0 and .NET Standard 2.1. | diff --git a/product_docs/docs/net_connector/8.0.5.1/release_notes/4.1.5.1_rel_notes.mdx b/product_docs/docs/net_connector/8.0.5.1/release_notes/4.1.5.1_rel_notes.mdx new file mode 100644 index 00000000000..bd0c72fdb79 --- /dev/null +++ b/product_docs/docs/net_connector/8.0.5.1/release_notes/4.1.5.1_rel_notes.mdx @@ -0,0 +1,12 @@ +--- +title: "Version 4.1.5.1" + +--- +The EDB .NET Connector provides connectivity between a .NET client application and an EDB Postgres Advanced Server database server. + +New features, enhancements, bug fixes, and other changes in the EDB .NET Connector `4.1.5.1` include: + +| Type | Description | +|----------------|--------------------------------------------------------------------------------------------------------------------------------------------------------| +| Upstream merge | Merged with the upstream Npgsql driver version 4.1.5. For more information about the merge updates, see . | +| Enhancement | Support for EDB Postgres Advanced Server 13. | diff --git a/product_docs/docs/net_connector/4.1.6.1/01_release_notes.mdx b/product_docs/docs/net_connector/8.0.5.1/release_notes/4.1.6.1_rel_notes.mdx similarity index 97% rename from product_docs/docs/net_connector/4.1.6.1/01_release_notes.mdx rename to product_docs/docs/net_connector/8.0.5.1/release_notes/4.1.6.1_rel_notes.mdx index edc991aac4b..6e413eec113 100644 --- a/product_docs/docs/net_connector/4.1.6.1/01_release_notes.mdx +++ b/product_docs/docs/net_connector/8.0.5.1/release_notes/4.1.6.1_rel_notes.mdx @@ -1,5 +1,5 @@ --- -title: "Release Notes" +title: "Version 4.1.6.1" legacyRedirects: - "/edb-docs/d/edb-postgres-net-connector/user-guides/net-guide/4.1.6.1/whats_new.html" diff --git a/product_docs/docs/net_connector/5.0.7.1/01_release_notes.mdx b/product_docs/docs/net_connector/8.0.5.1/release_notes/5.0.7.1_rel_notes.mdx similarity index 97% rename from product_docs/docs/net_connector/5.0.7.1/01_release_notes.mdx rename to product_docs/docs/net_connector/8.0.5.1/release_notes/5.0.7.1_rel_notes.mdx index 1d5612d4406..764e0d2f837 100644 --- a/product_docs/docs/net_connector/5.0.7.1/01_release_notes.mdx +++ b/product_docs/docs/net_connector/8.0.5.1/release_notes/5.0.7.1_rel_notes.mdx @@ -1,5 +1,5 @@ --- -title: "Release notes" +title: "Version 5.0.7.1" --- The EDB .NET Connector provides connectivity between a .NET client application and an EDB Postgres Advanced Server database server. diff --git a/product_docs/docs/net_connector/6.0.2.1/01_release_notes.mdx b/product_docs/docs/net_connector/8.0.5.1/release_notes/6.0.2.1_rel_notes.mdx similarity index 97% rename from product_docs/docs/net_connector/6.0.2.1/01_release_notes.mdx rename to product_docs/docs/net_connector/8.0.5.1/release_notes/6.0.2.1_rel_notes.mdx index 51cb5619462..f9136249603 100644 --- a/product_docs/docs/net_connector/6.0.2.1/01_release_notes.mdx +++ b/product_docs/docs/net_connector/8.0.5.1/release_notes/6.0.2.1_rel_notes.mdx @@ -1,5 +1,5 @@ --- -title: "Release notes" +title: "Version 6.0.2.1" --- The EDB .NET Connector provides connectivity between a .NET client application and an EDB Postgres Advanced Server database server. diff --git a/product_docs/docs/net_connector/7.0.4.1/01_release_notes.mdx b/product_docs/docs/net_connector/8.0.5.1/release_notes/7.0.4.1_rel_notes.mdx similarity index 97% rename from product_docs/docs/net_connector/7.0.4.1/01_release_notes.mdx rename to product_docs/docs/net_connector/8.0.5.1/release_notes/7.0.4.1_rel_notes.mdx index 31904f00654..4940d621e9a 100644 --- a/product_docs/docs/net_connector/7.0.4.1/01_release_notes.mdx +++ b/product_docs/docs/net_connector/8.0.5.1/release_notes/7.0.4.1_rel_notes.mdx @@ -1,5 +1,5 @@ --- -title: "Release notes" +title: "Version 7.0.4.1" --- The EDB .NET Connector provides connectivity between a .NET client application and an EDB Postgres Advanced Server database server. diff --git a/product_docs/docs/net_connector/7.0.6.1/01_release_notes.mdx b/product_docs/docs/net_connector/8.0.5.1/release_notes/7.0.6.1_rel_notes.mdx similarity index 97% rename from product_docs/docs/net_connector/7.0.6.1/01_release_notes.mdx rename to product_docs/docs/net_connector/8.0.5.1/release_notes/7.0.6.1_rel_notes.mdx index 30cbf66a4da..644de182b9e 100644 --- a/product_docs/docs/net_connector/7.0.6.1/01_release_notes.mdx +++ b/product_docs/docs/net_connector/8.0.5.1/release_notes/7.0.6.1_rel_notes.mdx @@ -1,5 +1,5 @@ --- -title: "Release notes" +title: "Version 7.0.6.1" --- Released: 25 Oct 2023 diff --git a/product_docs/docs/net_connector/7.0.6.2/01_release_notes.mdx b/product_docs/docs/net_connector/8.0.5.1/release_notes/7.0.6.2_rel_notes.mdx similarity index 97% rename from product_docs/docs/net_connector/7.0.6.2/01_release_notes.mdx rename to product_docs/docs/net_connector/8.0.5.1/release_notes/7.0.6.2_rel_notes.mdx index 9c1182fd1ed..515fba5630d 100644 --- a/product_docs/docs/net_connector/7.0.6.2/01_release_notes.mdx +++ b/product_docs/docs/net_connector/8.0.5.1/release_notes/7.0.6.2_rel_notes.mdx @@ -1,5 +1,5 @@ --- -title: "Release notes" +title: "Version 7.0.6.2" --- Released: 15 Feb 2024 diff --git a/product_docs/docs/net_connector/8.0.2.1/01_release_notes.mdx b/product_docs/docs/net_connector/8.0.5.1/release_notes/8.0.2.1_rel_notes.mdx similarity index 98% rename from product_docs/docs/net_connector/8.0.2.1/01_release_notes.mdx rename to product_docs/docs/net_connector/8.0.5.1/release_notes/8.0.2.1_rel_notes.mdx index 7d66ff9025d..3ec7ce88b03 100644 --- a/product_docs/docs/net_connector/8.0.2.1/01_release_notes.mdx +++ b/product_docs/docs/net_connector/8.0.5.1/release_notes/8.0.2.1_rel_notes.mdx @@ -1,5 +1,5 @@ --- -title: "Release notes" +title: "Version 8.0.2.1" --- Released: 15 May 2024 diff --git a/product_docs/docs/net_connector/8.0.5.1/01_release_notes.mdx b/product_docs/docs/net_connector/8.0.5.1/release_notes/8.0.5.1_rel_notes.mdx similarity index 98% rename from product_docs/docs/net_connector/8.0.5.1/01_release_notes.mdx rename to product_docs/docs/net_connector/8.0.5.1/release_notes/8.0.5.1_rel_notes.mdx index e8f855221dc..243957a7d90 100644 --- a/product_docs/docs/net_connector/8.0.5.1/01_release_notes.mdx +++ b/product_docs/docs/net_connector/8.0.5.1/release_notes/8.0.5.1_rel_notes.mdx @@ -1,5 +1,5 @@ --- -title: "Release notes" +title: "Version 8.0.5.1" --- Released: 22 Nov 2024 diff --git a/product_docs/docs/net_connector/8.0.5.1/release_notes/index.mdx b/product_docs/docs/net_connector/8.0.5.1/release_notes/index.mdx new file mode 100644 index 00000000000..092d8e1436d --- /dev/null +++ b/product_docs/docs/net_connector/8.0.5.1/release_notes/index.mdx @@ -0,0 +1,215 @@ +--- +title: "Release notes" +navigation: +- 8.0.5.1_rel_notes +- 8.0.2.1_rel_notes +- 7.0.6.2_rel_notes +- 7.0.6.1_rel_notes +- 7.0.4.1_rel_notes +- 6.0.2.1_rel_notes +- 5.0.7.1_rel_notes +- 4.1.6.1_rel_notes +- 4.1.5.1_rel_notes +- 4.1.3.1_rel_notes +- 4.0.10.2_rel_notes +- 4.0.10.1_rel_notes +- 4.0.6.1_rel_notes +--- + +The EDB .NET connector documentation describes the latest version of EDB .NET connector. + +These release notes describe what's new in each release. When a minor or patch release introduces new functionality, indicators in the content identify the version that introduced the new feature. + +| Version | Release Date | +| ---------------------------------------- | ------------ | +| [8.0.5.1](8.0.5.1_rel_notes) | 22 Nov 2024 | +| [8.0.2.1](8.0.2.1_rel_notes) | 15 May 2024 | +| [7.0.6.2](7.0.6.2_rel_notes) | 15 Feb 2024 | +| [7.0.6.1](7.0.6.1_rel_notes) | 25 Oct 2023 | +| [7.0.4.1](7.0.4.1_rel_notes) | | +| [6.0.2.1](6.0.2.1_rel_notes) | | +| [5.0.7.1](5.0.7.1_rel_notes) | | +| [4.1.6.1](4.1.6.1_rel_notes) | | +| [4.1.5.1](4.1.5.1_rel_notes) | 11 Nov 2020 | +| [4.1.3.1](4.1.3.1_rel_notes) | 22 Sep 2020 | +| [4.0.10.2](4.0.10.2_rel_notes)| 22 Sep 2020 | +| [4.0.10.1](4.0.10.1_rel_notes)| 22 Sep 2020 | +| [4.0.6.1](4.0.6.1_rel_notes) | 22 Sep 2020 | + + + + + + + +s +s + + + + + + + + + + + +s +s + + + + + + + + + + + +s +s + + + + + + + + + + + +s +s + + + + + + + + + + + +s +s + + + + + + + + + + + +s +s + + + + + + + + + + + +s +s + + + + + + + + + + + +s +s + + + + + + + + + + + +s +s + + + + + + + + + + + +s +s + + + + + + + + + + + +s +s + + + + + + + + + + + +s +s + + + + + + + + + + + +s +s + + + + + + + + + + + +s +s From f1360cab15f21f98e573cc3ac226dc5224b2d656 Mon Sep 17 00:00:00 2001 From: gvasquezvargas Date: Thu, 23 Jan 2025 17:10:53 +0100 Subject: [PATCH 2/3] Fixed local build --- .../docs/net_connector/8.0.5.1/index.mdx | 2 +- .../release_notes/7.0.6.2_rel_notes.mdx | 2 +- .../8.0.5.1/release_notes/index.mdx | 178 ------------------ 3 files changed, 2 insertions(+), 180 deletions(-) diff --git a/product_docs/docs/net_connector/8.0.5.1/index.mdx b/product_docs/docs/net_connector/8.0.5.1/index.mdx index 225651121ca..b76fa2a8c3c 100644 --- a/product_docs/docs/net_connector/8.0.5.1/index.mdx +++ b/product_docs/docs/net_connector/8.0.5.1/index.mdx @@ -3,7 +3,7 @@ title: "EDB .NET Connector" directoryDefaults: description: "EDB .NET Connector version 8.0.5.1 documentation and release notes." navigation: - - 01_release_notes + - release_notes - 02_requirements_overview - 03_the_advanced_server_net_connector_overview - 04_installing_and_configuring_the_net_connector diff --git a/product_docs/docs/net_connector/8.0.5.1/release_notes/7.0.6.2_rel_notes.mdx b/product_docs/docs/net_connector/8.0.5.1/release_notes/7.0.6.2_rel_notes.mdx index 515fba5630d..bc3c8f48e59 100644 --- a/product_docs/docs/net_connector/8.0.5.1/release_notes/7.0.6.2_rel_notes.mdx +++ b/product_docs/docs/net_connector/8.0.5.1/release_notes/7.0.6.2_rel_notes.mdx @@ -11,4 +11,4 @@ New features, enhancements, bug fixes, and other changes in the EDB .NET Connect | Type | Description | |--------------|--------------------------------------------------------------------------------------------------------------------------------------------| | Enhancement | .NET packages are now available on [nuget.org](https://www.nuget.org/). | -| Bug fix | Fixed an issue while any attempt to connect synchronously hung indefinitely, referencing the .Net Framework assembly using non-ASYNC code. | \ No newline at end of file +| Bug fix | Fixed an issue while any attempt to connect synchronously hung indefinitely, referencing the .Net Framework assembly using non-ASYNC code. | diff --git a/product_docs/docs/net_connector/8.0.5.1/release_notes/index.mdx b/product_docs/docs/net_connector/8.0.5.1/release_notes/index.mdx index 092d8e1436d..57c2e626504 100644 --- a/product_docs/docs/net_connector/8.0.5.1/release_notes/index.mdx +++ b/product_docs/docs/net_connector/8.0.5.1/release_notes/index.mdx @@ -35,181 +35,3 @@ These release notes describe what's new in each release. When a minor or patch r | [4.0.10.2](4.0.10.2_rel_notes)| 22 Sep 2020 | | [4.0.10.1](4.0.10.1_rel_notes)| 22 Sep 2020 | | [4.0.6.1](4.0.6.1_rel_notes) | 22 Sep 2020 | - - - - - - - -s -s - - - - - - - - - - - -s -s - - - - - - - - - - - -s -s - - - - - - - - - - - -s -s - - - - - - - - - - - -s -s - - - - - - - - - - - -s -s - - - - - - - - - - - -s -s - - - - - - - - - - - -s -s - - - - - - - - - - - -s -s - - - - - - - - - - - -s -s - - - - - - - - - - - -s -s - - - - - - - - - - - -s -s - - - - - - - - - - - -s -s - - - - - - - - - - - -s -s From 34ca0743afe304b5852514a0a2c1f06b65b8260f Mon Sep 17 00:00:00 2001 From: gvasquezvargas Date: Thu, 23 Jan 2025 17:29:17 +0100 Subject: [PATCH 3/3] Added consolidation redirects and fixed a link --- .../8.0.5.1/release_notes/8.0.5.1_rel_notes.mdx | 2 +- static/_redirects | 15 +++++++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/product_docs/docs/net_connector/8.0.5.1/release_notes/8.0.5.1_rel_notes.mdx b/product_docs/docs/net_connector/8.0.5.1/release_notes/8.0.5.1_rel_notes.mdx index 243957a7d90..b05e17f526f 100644 --- a/product_docs/docs/net_connector/8.0.5.1/release_notes/8.0.5.1_rel_notes.mdx +++ b/product_docs/docs/net_connector/8.0.5.1/release_notes/8.0.5.1_rel_notes.mdx @@ -13,5 +13,5 @@ New features, enhancements, bug fixes, and other changes in the EDB .NET Connect | Upstream merge | Merged with community .NET driver version 8.0.5 and EF Core Driver 8.0.10. See [release notes](https://www.npgsql.org/doc/release-notes/8.0.html) for more information about merge updates. | | | Bug fix | Fixed a performance issue. Performance is now improved when reading data while targeting .NET Framework 4.7.2, 4.8, and 4.8.1. | #41979 | | Enhancement | Added support for EDB Postgres Advanced Server 17.2. | | -| Enhancement | Added support for `IS TABLE OF`. EDB Postgres Advanced Server supports Oracle nested table collection types created with `CREATE TYPE ... AS TABLE OF` statements. See [Using nested tables](./using_nested_table_types.mdx) for more information. | | +| Enhancement | Added support for `IS TABLE OF`. EDB Postgres Advanced Server supports Oracle nested table collection types created with `CREATE TYPE ... AS TABLE OF` statements. See [Using nested tables](../using_nested_table_types) for more information. | | | Deprecation | Removed .NET5 and .NET7 targets as they have reached end of support. | | \ No newline at end of file diff --git a/static/_redirects b/static/_redirects index a291a0d2a0c..11e308329f2 100644 --- a/static/_redirects +++ b/static/_redirects @@ -132,6 +132,21 @@ /docs/odbc_connector/13.1.0.1/* /docs/odbc_connector/13/:splat 301 /docs/odbc_connector/13.0.0.1/* /docs/odbc_connector/13/:splat 301 +# .NET Connector +# collapsed versions +/docs/net_connector/4.0.6.1/* /docs/net_connector/latest/:splat 301 +/docs/net_connector/4.0.10.1/* /docs/net_connector/latest/:splat 301 +/docs/net_connector/4.1.3.1/* /docs/net_connector/latest/:splat 301 +/docs/net_connector/4.1.5.1/* /docs/net_connector/latest/:splat 301 +/docs/net_connector/4.1.6.1/* /docs/net_connector/latest/:splat 301 +/docs/net_connector/5.0.7.1/* /docs/net_connector/latest/:splat 301 +/docs/net_connector/6.0.2.1/* /docs/net_connector/latest/:splat 301 +/docs/net_connector/7.0.4.1/* /docs/net_connector/latest/:splat 301 +/docs/net_connector/7.0.6.1/* /docs/net_connector/latest/:splat 301 +/docs/net_connector/7.0.6.2/* /docs/net_connector/latest/:splat 301 +/docs/net_connector/8.0.2.1/* /docs/net_connector/latest/:splat 301 +/docs/net_connector/8.0.2.1/* /docs/net_connector/latest/:splat 301 + # PostGIS # Consolidated to latest version /docs/postgis/1.0/* /docs/postgis/latest/:splat 301