public addGenerics(int md) { mode = md; InitializeComponent(); if (mode == 1) { label1.Text = "Artist Name : "; label2.Dispose(); comboBox1.Dispose(); } if (mode == 2) { label1.Text = "Genre"; label2.Dispose(); comboBox1.Dispose(); } if (mode == 3) { label1.Text = "Album Name"; label2.Text = "Artist"; label2.Visible = true; comboBox1.Visible = true; comboBox1.DisplayMember = "ARTIST_NAME"; comboBox1.ValueMember = "Id"; comboBox1.DataSource = Db.sqlCustomQuery("SELECT * FROM ArtistTB"); } }
private void addSongForm_Load(object sender, EventArgs e) { try { artistCombo.ValueMember = "Id"; artistCombo.DisplayMember = "ARTIST_NAME"; artistCombo.DataSource = Db.sqlCustomQuery("SELECT Id, ARTIST_NAME FROM ArtistTB"); genreCombo.ValueMember = "Id"; genreCombo.DisplayMember = "GENRE_NAME"; genreCombo.DataSource = Db.sqlCustomQuery("SELECT * FROM GenreTB"); } catch (Exception Ex) { MessageBox.Show(Ex.Message.ToString()); } }
private void searchGenerics_Load(object sender, EventArgs e) { try { switch (searchMode) { case 1: { //Search by length label1.Visible = true; label1.Text = "Searching by Song Length :"; numericUpDown1.Visible = true; numericUpDown2.Visible = true; groupBox1.Visible = true; radioEQ.Visible = true; radioGT.Visible = true; radioLT.Visible = true; break; } case 2: { //Search by artist label1.Visible = true; label1.Text = "Searching by Song Artist :"; searchCombo.Visible = true; searchCombo.ValueMember = "Id"; searchCombo.DisplayMember = "ARTIST_NAME"; searchCombo.DataSource = db.sqlCustomQuery("SELECT * FROM ArtistTb"); break; } case 3: { //Search by year label1.Visible = true; label1.Text = "Searching by Song Year :"; searchCombo.Visible = true; searchCombo.ValueMember = "SONG_YEAR"; searchCombo.DisplayMember = "SONG_YEAR"; searchCombo.DataSource = db.sqlCustomQuery("SELECT SONG_YEAR FROM SongListTb"); break; } case 4: { //Search by genre label1.Visible = true; label1.Text = "Searching by Song Genre :"; searchCombo.Visible = true; searchCombo.ValueMember = "Id"; searchCombo.DisplayMember = "GENRE_NAME"; searchCombo.DataSource = db.sqlCustomQuery("SELECT * FROM GenreTb"); break; } case 5: { //Delete Song label1.Visible = true; label1.Text = "Delete Song :"; searchCombo.Visible = true; searchCombo.ValueMember = "Id"; searchCombo.DisplayMember = "SONG_NAME"; searchCombo.DataSource = db.sqlCustomQuery("SELECT * FROM SongListTb"); break; } case 6: { //Delete Artist label1.Visible = true; label1.Text = "Delete Artist :"; searchCombo.Visible = true; searchCombo.ValueMember = "Id"; searchCombo.DisplayMember = "ARTIST_NAME"; searchCombo.DataSource = db.sqlCustomQuery("SELECT * FROM ArtistTb"); break; } case 7: { //Delete Album label1.Visible = true; label1.Text = "Delete Album :"; searchCombo.Visible = true; searchCombo.ValueMember = "Id"; searchCombo.DisplayMember = "ALBUM_NAME"; searchCombo.DataSource = db.sqlCustomQuery("SELECT * FROM AlbumTb"); break; } case 8: { //Delete Genre label1.Visible = true; label1.Text = "Delete Genre :"; searchCombo.Visible = true; searchCombo.ValueMember = "Id"; searchCombo.DisplayMember = "GENRE_NAME"; searchCombo.DataSource = db.sqlCustomQuery("SELECT * FROM GenreTb"); break; } } } catch (Exception Ex) { MessageBox.Show(Ex.Message.ToString()); } }
private void fetchArtists_Click(object sender, EventArgs e) { dataGridView1.DataSource = Database.sqlCustomQuery("SELECT ARTIST_NAME as Artist FROM ArtistTB"); }