public string CreateMahasiswa(Mahasiswa mhs)
        {
            string        msg    = "GAGAL";
            SqlConnection sqlcon = new SqlConnection("Data Source=DESKTOP-O339P25;Initial Catalog=TI UMY;Persist Security Info=True;User ID=sa;Password=dede162700");
            string        query  = string.Format("Insert into dbo.Mahasiswa values ('{0}', '{1}', '{2}', '{3}',)", mhs.nama, mhs.nim, mhs.prodi, mhs.angkatan);
            //NIM = '{0}'", nim
            SqlCommand sqlcom = new SqlCommand(query, sqlcon); //yang dikirim ke sql

            try
            {
                sqlcon.Open();            //membuka connection sql
                Console.WriteLine(query);
                sqlcom.ExecuteNonQuery(); //mengeksusi untuk memasukkan data
                sqlcon.Close();
                msg = "sukses";
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message);
                Console.WriteLine(query);
                msg = "GAGAL";
            }
            return(msg);
        }