static void Main(string[] args) { Customer[] list = { new Customer("12345", "Spartan", "SG") }; MySQLClient.Create(list[0]); }
public static void Create(Customer customerObj) { string clientSocket = "" + "Data Source=localhost;" + "Initial Catalog=Northwind;" + "Persist Security Info=True;" + "User ID=sa;" + "Password=Passw0rd2018"; using (SqlConnection con = new SqlConnection(clientSocket)) { con.Open(); Console.WriteLine(con.State); try { MySQLClient.UpdateWithStoreProcedure(con, "2019", "KING LEONIDAS", "THIS IS SPRTA"); } catch (SqlException ex) { Console.WriteLine("EXCEPTION::SQL_ERROR : " + ex.Message); } } }