Example SQL connection
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using System.Data;
- using MySql.Data.MySqlClient;
- namespace Perpustakaan
- {
- class Example
- {
- }
- class DbMySQL
- {
- string ConnString ;
- public DbMySQL()
- {
- ConnString="DataSource=localhost;Username=root;password=;Database=db_perpus_ik3";
- }
-
-
- public DataTable GetDataTable(string Query)
- {
- DataTable result = new DataTable();
- MySqlConnection MyConn = new MySqlConnection(ConnString);
- MyConn.Open();
- MySqlCommand MyComm = new MySqlCommand(Query, MyConn);
- MySqlDataReader myReader = MyComm.ExecuteReader();
- result.Load(myReader);
- MyConn.Close();
- return result;
- }
-
-
-
-
- public void ExecuteNonQuery(string Query)
- {
- MySqlConnection myConn = new MySqlConnection(ConnString);
- myConn.Open();
- MySqlCommand myComm = new MySqlCommand(Query, myConn);
- myComm.ExecuteNonQuery();
- myConn.Close();
- }
- }
- }
FireBird Class ??? Example ??? Please ???