{"id":232,"date":"2021-11-02T20:01:23","date_gmt":"2021-11-02T20:01:23","guid":{"rendered":"https:\/\/ouritsource.com\/blog\/?p=232"},"modified":"2025-05-29T13:04:47","modified_gmt":"2025-05-29T13:04:47","slug":"connect-c-to-mysql-example","status":"publish","type":"post","link":"https:\/\/ouritsource.com\/blog\/connect-c-to-mysql-example\/","title":{"rendered":"Connect C# to mySQL Example"},"content":{"rendered":"<body>\n<p>This example requires MySQL.Data.MySqlClient and System.Data.SqlClient to insert data into a MySQL database. Originally, I had an error during execution: IO.FileNotFoundException in MySql.Data.dll: Can\u2019t load System.Security.Permissions. To fix the issue. I had to go to SOLUTION EXPLORER and right-click the project name and go to MANAGE NUGET PACKAGE. From there, I had to go to BROWSE (Center of the screen) and look for MYSQL.DATA. Once found, I had to install MYSQL.DATA (This version was 8.0.18). Once installed that fixed problem.<\/p>\n\n\n\n[code]\n<div style=\"width:100%; padding-bottom:56.25%; position:relative;\">\n  <iframe src=\"https:\/\/www.ouritsource.com\/apps\/codingexamples\/showcode.php?ref=61\" style=\"position:absolute; top:0px; left:0px; \n  width:100%; height:100%; border: none; overflow: hidden;\"><\/iframe>\n<\/div>\n[\/code]\n\n\n\n<p><\/p>\n<\/body>","protected":false},"excerpt":{"rendered":"<p>This example requires MySQL.Data.MySqlClient and System.Data.SqlClient to insert data into a MySQL database. Originally, I had an error during execution: IO.FileNotFoundException in MySql.Data.dll: Can\u2019t load System.Security.Permissions. To fix the issue. I had&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"om_disable_all_campaigns":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[7],"tags":[],"class_list":["post-232","post","type-post","status-publish","format-standard","hentry","category-c-c-c","no-thumbnail"],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/ouritsource.com\/blog\/wp-json\/wp\/v2\/posts\/232","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ouritsource.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ouritsource.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ouritsource.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ouritsource.com\/blog\/wp-json\/wp\/v2\/comments?post=232"}],"version-history":[{"count":3,"href":"https:\/\/ouritsource.com\/blog\/wp-json\/wp\/v2\/posts\/232\/revisions"}],"predecessor-version":[{"id":467,"href":"https:\/\/ouritsource.com\/blog\/wp-json\/wp\/v2\/posts\/232\/revisions\/467"}],"wp:attachment":[{"href":"https:\/\/ouritsource.com\/blog\/wp-json\/wp\/v2\/media?parent=232"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ouritsource.com\/blog\/wp-json\/wp\/v2\/categories?post=232"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ouritsource.com\/blog\/wp-json\/wp\/v2\/tags?post=232"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}