Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using System.Windows.Forms;
- using MySql.Data.MySqlClient;
- namespace tgs4_vb_stb
- {
- class koneksi
- {
- public static string host = "localhost";
- public static string username = "root";
- public static string database = "anu_db";
- public static string password = "";
- public static string connect = "server=" + host + ";username=" + username + ";database=" + database + ";password=" + password;
- public static MySqlConnection konek = new MySqlConnection(connect);
- public static void konn()
- {
- try
- {
- konek.Open();
- MessageBox.Show("Selamat Anda Berhasil Koneksi ke Database");
- }
- catch
- {
- konek.Close();
- MessageBox.Show("Database tidak terhububg");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement