I'm attempting to create a method that I can call on any form in order to establish a mysql connection. This is the code I have
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using MySql.Data.MySqlClient;
namespace micromini
{
public class dbcon
{
public void dbconnector
{
string strConnection = "host=50.87.144.250; database=twhalen_storage; username=twhalen_software; password=Karatom14!;";
MySqlConnection conSQL = new MySqlConnection(strConnection);
try
{
conSQL.Open();
}
catch (Exception ex)
{
string exstring = ex.ToString();
MessageBox.Show(exstring);
}
MessageBox.Show("Welcome!");
}
}
}
The error I get is A get or set accessor expected
. Any ideas?