Jump to content

C# Mysql Rehber Örneği


KintaRo
 Share

Recommended Posts

Bir arkadaşımızın isteği üzerine küçük bir örnek hazırladım. Aslında bir süredir aklımdaydı ama anca fırsat bulduk diyelim.

 

Projede MySQL bağlantısı için MySQL.Data.dll 6.9.5.0 versiyonunu kullandım. Bu dll dosyasını referans olarak ekleyince tüm .NET 4.5 kurulu tüm sistemlerde sorunsuz bağlantı sağlayacaktır. MySQ yönetimi için Library klasöründe MySQL class'ı bulunmaktadır. Bu class içinde 

 

void MySQL.Query(string sorgu); // insert, delete, update gibi işlemler için

int MySQL.Count(string sorgu); // satır sayısı için

DataTable MySQL.GetDataTable(string sorgu); // birden çok satırı çekmek için

string MySQL.tekSutun(string sorgu); // select isim from rehber gibi tek sütun ve tek veri için

 

public metodları bulunmaktadır.

 

Projeyi kullanabilmeniz için Xampp/Wamp gibi bir yerel mysql sunucusu ya da remote mysql destekli web siteniz olması gerekmektedir. Yerel ağda phpmyadmin ayarlarını aşağıdaki gibi yaparsanız tüm bilgisayarlardan verilere ulaşabilirsiniz:

 

CbquWlW.png

 

yani veritabanı kullanıcısına bağlanacak ip lere izin vermeniz gerekmektedir. Yukarıda IP adresi 192.168 ile başlayan tüm iplere izin verildiği görülüyor.

 

Daha sonra phpmyadminden ornekdb adlı bir veritabanı oluşturup ekteki dosyada bulunan ornekdb.sql dosyasını bu veritabanını import etmeniz gerekiyor.

 

aHxe7kE.png

 

Son olarak Projemizde Solution penceresinden Library klasöründe bulunan MySQL.cs dosyasındaki şu satırları kendi bağlantınıza göre düzenlemelisiniz:

 

        private void Initialize()
        {
            server = "localhost";
            uid = "root";
            password = "";
            database = "ornekdb";
            port = "3306";
            string connectionString = String.Format("SERVER={0};DATABASE={1};UID={2};PASSWORD={3};charset=utf8;PORT={4}", server, database, uid, password, port);
            connection = new MySqlConnection(connectionString);
        }

Hepsi bu kadar. 

 

eu2BIof.png

https://yadi.sk/d/1QB56qLDhU7nd
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

  • Similar Content

    • By artae
      File size: 69 MB

      Cross Platform Compare and Sync Schema and Data for Oracle and MySQL.

      Cross Platform Compare
      SQL DXP can compare like for like databases, so Oracle Server to Oracle Server the same way that SQL Delta performs a compare. In addition SQL DXP can compare different database servers and transfer the schema and/or data across different platforms.

      Schema Compare
      SQL DXP will convert various objects of the source database into compatible objects for the target database. For example MySQL to Oracle Server converts the MySQL database into a Oracle Server form so the compare is then like for like.

      It is important to note that not all objects and properties can be converted. MySQL doesn't support the feature set of Oracle Server however the objects are left as is to show the entire schema of the source database.

      Data Compare
      The cross platform data compare can be more closely aligned given common data types. Data compare provides a convenient way to transfer data from two different platforms with a very common use transferring web based MySQL data back into a backend SQL Server database.

      Whats New:
      Fixed Oracle issue with create package
      Bug fixes

      HOMEPAGE
      https://www.sqldelta.com
      DOWNLOAD
      (Buy premium account for maximum speed and resuming ability)


      https://nitroflare.com/view/2E5172AB5B76BB9/i026i.SQL.DXP.for.Oracle.and.MySQL.6.6.0.182.rar



      https://rapidgator.net/file/59340447e08d79e91f098a2d64f6f339/i026i.SQL.DXP.for.Oracle.and.MySQL.6.6.0.182.rar


    • By artae
      File size: 122 MB (x64)

      dbForge Studio for MySQL is a universal GUI tool for MySQL and MariaDB database development, management, and administration. The IDE allows you to create and execute queries, develop and debug stored routines, automate database object management, analyze table data via an intuitive interface. The MySQL client delivers data and schema comparison and synchronization tools, database reporting tools, backup options with scheduling, and much more.

      In addition, dbForge Studio for MySQL is a perfect alternative to MySQL Workbench. Check out the pros of our tool over MySQL Workbench!
      Database Development
      Building, editing, and running queries, as well as measuring and optimizing query performance get much simpler with the following functionality
      Database Design
      Database design tools allow users to create a database diagram, objects, projects, as well as to compare and synchronize database schemas efficiently and in a user-friendly interface.
      Database Administration
      With these features, users can manage their accounts, set up permissions, monitor open sessions and their activity, as well as perform table maintenance. In addition, it is possible to back up and restore databases to/from a backup file.
      Data Reports and Analysis
      Creation of data reports and pivot tables, as well as data comparison and synchronization may take much time and efforts while your work can be more productive using the following features.
      Whats New
      https://blog.devart.com/dbforge-studio-for-mysql-90.html

      HomePage:
      https://www.devart.com/
      DOWNLOAD
      (Buy premium account for maximum speed and resuming ability)


      https://nitroflare.com/view/843CD77E5504F8E/fx1js.dbForge.Studio.2020.for.MySQL.Enterprise.9.0.791.rar



      https://rapidgator.net/file/6421759f95234bf5e612f252e39d55b6/fx1js.dbForge.Studio.2020.for.MySQL.Enterprise.9.0.791.rar


    • By artae
      SQL DXP for SQL Server and MySQL 6.6.0.180
      66.8 Mb

      Cross Platform Compare and Sync Schema and Data for SQL Server and MySQL.

      Cross Platform Compare
      SQL DXP can compare like for like databases, so SQL Server to SQL Server the same way that SQL Delta performs a compare. In addition SQL DXP can compare different database servers and transfer the schema and/or data across different platforms.

      Schema Compare
      SQL DXP will convert various objects of the source database into compatible objects for the target database. For example MySQL to SQL Server converts the MySQL database into a SQL Server form so the compare is then like for like.

      It is important to note that not all objects and properties can be converted. MySQL doesn't support the feature set of SQL Server however the objects are left as is to show the entire schema of the source database.

      Data Compare
      The cross platform data compare can be more closely aligned given common data types. Data compare provides a convenient way to transfer data from two different platforms with a very common use transferring web based MySQL data back into a backend SQL Server database.

      Operating System:Windows 7, 8/8.1, 10
      DOWNLOAD
      (Buy premium account for maximum speed and resuming ability)


      https://nitroflare.com/view/5A091E92FB41DC8/7oxrv.SQL.DXP.for.SQL.Server.and.MySQL.6.6.0.180.rar



      https://rapidgator.net/file/9c4c5e1922f265adc3a1f51ab240433d/7oxrv.SQL.DXP.for.SQL.Server.and.MySQL.6.6.0.180.rar


    • By artae
      File size: 77 MB

      Navicat for MySQL is the ideal solution for MySQL/MariaDB administration and development.

      It is a single application that allows you to connect to MySQL and MariaDB databases simultaneously. Compatible with cloud databases like RDS, Aurora, Oracle Cloud and Google Cloud. This all-inclusive frontend provides an intuitive and powerful graphical interface for database management, development, and maintenance.

      Seamless Data Migration

      Data Transfer, Data Synchronization and Structure Synchronization help you migrate your data easier and faster for less overhead. Deliver detailed, step-by-step guidelines for transferring data across databases. Compare and synchronize databases with Data and Structure Synchronization. Set up and deploy the comparisons in seconds, and get the detailed script to specify the changes you want to execute.

      Diversified Manipulation Tool

      Use Import Wizard to transfer data into a database from diverse formats, or from ODBC after setting up a data source connection. Export data from tables, views, or query results to formats like Excel, Access, CSV and more. Add, modify, and delete records with our spreadsheet-like Grid View together with an array of data editing tools to facilitate your edits. Navicat gives you the tools you need to manage your data efficiently and ensure a smooth process.

      Easy SQL Editing

      Visual SQL Builder will help you create, edit and run SQL statements without having to worry about syntax and proper usage of commands. Code fast with Code Completion and customizable Code Snippet by getting suggestions for keywords and stripping the repetition from coding.

      Intelligent Database Designer

      Create, modify and manage all database objects using our professional object designers. Convert your databases into graphical representations using a sophisticated database design and modeling tool so you can model, create, and understand complex databases with ease.

      Increase your Productivity

      Our powerful local backup/restore solution guides you through the backup process and reduces the potential for errors. Compile professional high-quality reports in minutes using an interactive design interface and efficient workflow, and set an automation for repeatable deployment process like report generation, database backup, and script execution at a specific or day. No matter where you are, you can always get the job done.

      Make Collaboration Easy

      Synchronize your connection settings, models, queries and virtual groups to our Navicat Cloud service so you can get real- access to them, and share them with your coworkers any and anywhere. With Navicat Cloud, you can leverage every minute of your day to maximize your productivity.

      Advanced Secure Connection

      Establish secure connections through SSH Tunneling and SSL ensure every connection is secure, stable, and reliable. Support different authentication methods of database servers such as PAM authentication. Navicat provides more authentication mechanisms and high-performance environments so you never have to worry about connecting over an insecure network.
      DOWNLOAD
      (Buy premium account for maximum speed and resuming ability)


      https://nitroflare.com/view/4F3C8A8409DDCBC/zcqmy.Navicat.for.MySQL.15.0.26.rar



      https://rapidgator.net/file/532e04fe23bbd013b2a285c50901d6dd/zcqmy.Navicat.for.MySQL.15.0.26.rar


    • By artae
      File size: 77 MB

      Navicat for MySQL is the ideal solution for MySQL/MariaDB administration and development.

      It is a single application that allows you to connect to MySQL and MariaDB databases simultaneously. Compatible with cloud databases like RDS, Aurora, Oracle Cloud and Google Cloud. This all-inclusive frontend provides an intuitive and powerful graphical interface for database management, development, and maintenance.

      Seamless Data Migration

      Data Transfer, Data Synchronization and Structure Synchronization help you migrate your data easier and faster for less overhead. Deliver detailed, step-by-step guidelines for transferring data across databases. Compare and synchronize databases with Data and Structure Synchronization. Set up and deploy the comparisons in seconds, and get the detailed script to specify the changes you want to execute.

      Diversified Manipulation Tool

      Use Import Wizard to transfer data into a database from diverse formats, or from ODBC after setting up a data source connection. Export data from tables, views, or query results to formats like Excel, Access, CSV and more. Add, modify, and delete records with our spreadsheet-like Grid View together with an array of data editing tools to facilitate your edits. Navicat gives you the tools you need to manage your data efficiently and ensure a smooth process.

      Easy SQL Editing

      Visual SQL Builder will help you create, edit and run SQL statements without having to worry about syntax and proper usage of commands. Code fast with Code Completion and customizable Code Snippet by getting suggestions for keywords and stripping the repetition from coding.

      Intelligent Database Designer

      Create, modify and manage all database objects using our professional object designers. Convert your databases into graphical representations using a sophisticated database design and modeling tool so you can model, create, and understand complex databases with ease.

      Increase your Productivity

      Our powerful local backup/restore solution guides you through the backup process and reduces the potential for errors. Compile professional high-quality reports in minutes using an interactive design interface and efficient workflow, and set an automation for repeatable deployment process like report generation, database backup, and script execution at a specific or day. No matter where you are, you can always get the job done.

      Make Collaboration Easy

      Synchronize your connection settings, models, queries and virtual groups to our Navicat Cloud service so you can get real- access to them, and share them with your coworkers any and anywhere. With Navicat Cloud, you can leverage every minute of your day to maximize your productivity.

      Advanced Secure Connection

      Establish secure connections through SSH Tunneling and SSL ensure every connection is secure, stable, and reliable. Support different authentication methods of database servers such as PAM authentication. Navicat provides more authentication mechanisms and high-performance environments so you never have to worry about connecting over an insecure network.
      DOWNLOAD
      (Buy premium account for maximum speed and resuming ability)


      https://nitroflare.com/view/4F3C8A8409DDCBC/zcqmy.Navicat.for.MySQL.15.0.26.rar



      https://rapidgator.net/file/532e04fe23bbd013b2a285c50901d6dd/zcqmy.Navicat.for.MySQL.15.0.26.rar


  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...